Unity 2020.1.0b8: SceneHierarchyWindow.Paint continues to be the #1 performance issue for me while being in play mode. I’ve attached Profiler screenshots.
I’m not sure how valuable these screenshots are to you. Please let me know whether they are helpful, because if they are not, what would be helpful to provide so you can improve performance in that area?
I tend to hide the hierarchy contents by collapsing the scene because of this, its a noticeable improvement. Hopefully theres some ms they can shave off the hierarchy creation/rendering logic in the future.
Ok so those two situations is expected when there has been a structural change to the transform hierarchy. The hierarchy is rebuilding it’s view in SyncIfNeeded and lazy initializes and caches the name of each item on the first repaint.
So it seems like is that something in your game logic is constantly making transform structural changes (re-parenting , sibling order changes or renaming gameobjects).
I know that we have had an issue with transform.SetAsLastSibling() that would dirty the hierarchy state when called even if the transform is already the last sibling, a fix is coming for that. But you can search for that on your side.
And we will look into where we can shave time off on our side.
Yep, that’s spot on and I guess all of the three examples happen
The game utilizes gameobject pooling for a lot of stuff, objects get acquired from a pool, change their parent and get renamed for debugging purposes, just to name one path where this occurs. While I could get rid of the renaming, I can’t get rid of the other points.
You seem to have an unique approach to investigate performance issues, that I would like to understand. Please excuse me if I ask the obvious.
My approach would have been to investigate the path where most performance is being spent, that would be GameObjectTreeViewGUI.OnContentGUI with 4.5ms, but you went straight to GameObjectTreeViewItem.get_DisplayName which costs 0.25ms.
Why did you go for the 0.25ms cost rather than the 4.5ms?
SceneHierarchyWindow.Paint is a big pain point for me too. You can work around it by de-selecting the Hierarchy tab when in play mode. Here’s an editor script that does it for you automatically.
Put your Animation tab next to Hierarchy and Lighting next to Inspector to make it work
I am getting this in 2023.2 (not in 2023.1). Opening the hierarchy causes a massive delay (OnGUI). Also happens on turning a gameobject on/off in Inspector. This is edit not play mode.
EDIT: I had an cloud backup running. Even through this is not backing up Unity projects it had a massive impact on this particular issue. It’s funny how it affects this particular version of Unity. I do still feel 2023.2 editor seems more laggy than 2023.1.
This is also confirmed in unity2022.3.13. In my case, the load is heavier when the objects on the timeline are in blend state, and the same is true when the Hierarchy is closed, which lightens the load.