How to determine what is destroying editor performance?

Whenever I select any object in Hierarchy, performance in editor’s play mode tanks. I’m seeing around 5-6ms with no object selected, which degrades to 15ms minimum for very simple object Inspector rendering up to 20-30ms for more complex objects with more components on them.

How do I determine what is causing this?

Seems like I can’t expand the profiler for EditorLoop in Play mode even with Deep Profiling enabled. So I tried to profile Edit mode instead, but all of these just look like internal Unity calls.

With Deep Profiling disabled:

Are we paying a heavy cost due to legacy IMGUI UI being embedded UITK elements?

From memory a IMGUIContainer visual element does make IMGUI inspectors repaint more than probably should. Though there’s nothing in the manual or docs that indicates this.

That itself would have some overhead in a complicated inspector like the camera (I’ve looked, it’s thousands of lines of code). The repainting would also cause a re-serialisation every repaint, which itself adds extra overhead. I wouldn’t imagine a camera component to constitute that much serialised data, but in the end it all adds on top of what is going on in play mode.

Well, that’s unfortunate, since I’m seeing a lot of stutter with basically nothing in the scene, just some tweened UGUI with PrimeTween doing the work. Everything goes back to normal as soon as I close the Inspector, but that’s no way to work.

Turned out to be a 3rd party asset that doesn’t show up in the Profiler for unknown reasons but apparently causes Inspector redraw to be called way more often than Unity regularly does on all Inspectors even if the asset is not in use. Removed the asset and editor is running well again.

1 Like

Hi PanthenEye - I’d be interested in taking a look to see if I can work out why the 3rd part asset isn’t showing up in the Profiler. If you can message me and let me know about the asset I’ll see what we can do!