Low performance in editor, but working fine in build

Tried googling this but all I see are people saying the opposite (slow in build instead).

My game seems to be working fine in build, but is running quite low framerate in editor. (15-30fps in editor, stable 60fps in build).

I’ve checked the profiler and seems what takes the most amount of processing is GUI.ProcessEvents. I don’t have any OnGUI stuff in the scene though:

3189874--243566--upload_2017-8-20_19-21-16.png

Working on Unity 5.6.3p1, on Windows 10

EDIT: I just discovered something peculiar. If I dock the game window in the same area as the scene window, the performance spikes back up to full 60fps. As soon as I undock it into its own window, it drops down again. If I dock it to another area, for example down where my console is at, the performance stays low. VERY strange, this seems like a bug in the editor?

EDIT: Just made another discovery - seems the performance is only slow if the Scene view is open. If I close the scene view or switch to another tab so the scene view is hidden, the performance is fine

That’s normal, performance is always worse in the Editor than in actual builds, because the Editor is doing a lot of things in the background that let you control how the game runs, as well as running its own GUI in the same system threads as your game. The profiler slows it down even more. If you have the Scene View visible, that has to be rendered as well as the Game View, so will add to slowness, same as if you had two cameras visible rendering your game at the same time (as well as making checks to isVisible true even if something isn’t visible in the Game window).

You should always use actual builds to test performance if you can.

3 Likes