The profiler here is telling me I am getting over 1000fps, while the stats window is showing me ~280.
This has been going on for several months now. What you’re seeing is my UI scene’s performance. The actual game scene gets ~300fps, typically. The above image is something that’s been happening randomly. It doesn’t always do this. Sometimes, these two will show relatively the same fps. The profiler is typically higher, but I hear that’s normal. It’s been getting worse and worse over the last few months, so I decided to try something, on a whim - deleting my Library folder.
This actually worked. In fact, it solved my fps problems so well, that now I’m getting the best performance I’ve ever seen with this project. Actual builds have never been an issue, though. They always have very high fps numbers, so I wasn’t really worried about this until lately, where it’s been happening more and more in the editor.
I’m not exactly sure what causes this, but I just wanted to post this here to perhaps help someone that might be having the same issue. I’m a little concerned that there may be some other, underlying issue that I’m not aware of, because simply deleting the Library folder shouldn’t have this much of an impact on performance…
So, clearing out my Library folder only had a temporary affect on this FPS reporting issue. I’ve also noticed that the FPS in the game window appears to correspond to the stats window’s FPS, and not the profiler’s FPS numbers.
That said, I think I may have found the culprit -
During all of my editor usage, I have an editor layout that uses multiple windows and monitors. I have the main editor window on my main monitor, and then I have the project and tile palette windows on a second monitor, split between the two (in the same main window on the second monitor).
If I close the second window (with the project/tile palette slip), my FPS suddenly jumps up to normal, and I no longer have any FPS issues. As soon as I apply the multi-monitor layout, my FPS (in the game and stats windows) tanks. Why would having multiple editor windows open have such an alarming impact on FPS? Also, the FPS problem isn’t consistent, as in I can have the layout open and the FPS is fine sometimes, but will randomly tank, but if I just have the main editor window open, without using the multi-window, multi-monitor layout, my FPS is always perfect.
I suppose for testing, I’ll have to remember to close out my multi-monitor layout in favor of FPS. Or, I suppose I could create multiple layouts, one for game testing, and one for editing…
You have toggled of visibility for the “Others” category in that graph, hiding a bunch of work, some of which would be related to drawing the Editor. With multiple windows and monitors at different refresh rates, that can then easily affect the final frame rate for the entire Editor.
Since the Game view and Playmode are part of that whole Editor, you can’t really extricate the pure game performance out of that. For that, you’ll have to make a build and profile on the target device.
Both monitors run at identical refresh rates. That said, I do seem to have “Others” hidden here, which I did not account for.
I just didn’t expect such a massive drop in performance with multiple windows/monitors. Also, that still doesn’t explain why it was random. Sometimes the FPS would drop, then I’d restart Unity, open the same exact layout, and all would be fine again. Then, randomly, the FPS would drop again. Not only that, but over time the performance would slowly get worse and worse without changing anything.
I’m just going to take this as a learning experience, and just run with two separate layouts. I appreciate the info, nonetheless
If you ever need to dig deeper, switch the target from Playmode to Editor and it’ll give you a detailed breakdown of what was slow in the Editor, that might help you understand why it happens sporadically.