Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Feedback (Case 1158368) Hierarchy window performance degradation

Discussion in '2019.3 Beta' started by Peter77, May 25, 2019.

  1. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,622
    Playing the game attached to Case 1108597 in 2019.3.0a3 editor feels very slow and unresponsive compared to earlier Unity versions. Looking at the Profiler shows a 43ms cost on "EditorLoop" pretty much all the time.

    What can I do to get rid of this cost and make it playable in the editor again? "Deep Profile" unfortunately does not reveal any information on that EditorLoop entry.

    upload_2019-5-25_15-19-26.png

    upload_2019-5-25_15-25-54.png

    I did not have any object selected where an expensive inspector window was shown. Only the game view, hierarchy, project window and console was visible.
     
    Last edited: May 25, 2019
    LeonhardP likes this.
  2. alexeyzakharov

    alexeyzakharov

    Joined:
    Jul 2, 2014
    Posts:
    508
    Could you please enable "Profiler Editor" to see what's taking time in the EditorLoop.
     
    Peter77 likes this.
  3. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,622
    Hi Alex, thanks for the quick help!

    "Profile Editor" revealed the performance degradation is caused by the Hierarchy window. When I close the Hierarchy window, performance is significantly better. I believe still slower than in earlier versions, but much better.

    I've submitted a bug-report and also attached the saved profiler data of both cases, with and without having the Hierarchy window open.

    (Case 1158368) 2019.3: Hierarchy window performance degradation
    https://issuetracker.unity3d.com/is...erarchy-contains-a-high-number-of-gameobjects

    prof_1_hierarchy_open.png
    prof_2_hierarchy_open.png


    prof_3_hierarchy_closed.png
     
    Last edited: Jul 11, 2019
  4. alexeyzakharov

    alexeyzakharov

    Joined:
    Jul 2, 2014
    Posts:
    508
    @Peter77 Thank you for the test and for the reporting the issue!
     
    Peter77 likes this.
  5. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    318
    Thanks @Peter77

    I've just upgraded my project from Unity 2018.4.1f1 to Unity 2019.1.5f1 -- apart from the editor being slower than the previous versions (again), I'm also seeing a significant performance issue when the Hierarchy window is open. It actually makes the editor near unusable when I'm editing multiple scenes!

    Only work around right now, is to have the hierarchy window open, but not visible... then only switch to it when you want to do something specific (which is often), grind your teeth trying to complete said task and then hide the hierarchy window again after.

    Please fix this urgently and back-port for the fix to Unity 2019.1.5f1 as well. I cannot believe a bug like this made it into a major release. :(

    // WildStyle
     
    ROBYER1, alexeyzakharov and Peter77 like this.
  6. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,622
    Thanks for letting us know you see this issue too, because Unity QA have difficulties to reproduce it.
     
    Last edited: Jun 9, 2019
    alexeyzakharov likes this.
  7. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    318
    That's interesting, it's really apparent on my project(s).
    • If I reset the layout to Default the problem is gone / much better.
    • However, soon as I select something in the hierarchy things start slowing down.
    • If I use a multi monitor layout and my usual layout with hierarchy on the other monitor it's even slower.
    • Add a multi scene setup and it gets slower yet again.
    • If I reset to my custom layout it gets faster for a moment, then as soon as I select something it starts again.

    // WildStyle
     
    cirocontinisio and Peter77 like this.
  8. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    318
    Adding to this - when I click to expand / collapse something in the hierarchy it takes around 3 seconds after I've clicked for the action to happen!

    // WildStyle
     
  9. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,622
  10. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    318
    Wow - this is great news, thank you Peter!

    Looking at the description on the issue, seems there could be more to it than this based on my experiences. However, hopefully the issues relate, so fixing the root cause will fix all.

    // WildStyle
     
    Peter77 likes this.
  11. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    318
    This issue is making my Unity productivity a misery.. I'm attaching a screenshot from my profiler of the editor overhead.

    2019-08-17_13h08_14.png

    I can see where it's happening.. but not the details beyond that. My development workflow has been suffering from this for months now. Any idea when this will be fixed?

    // WildStyle
     
  12. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    318
    Another weird side-effect / symptom -- when in play mode the same editor hierarchy view performance is much better. When stopping play the issue comes back again the same.

    // WildStyle
     
  13. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    318
    Update here: I tracked my problem to an asset, it looks like one of the editor upgrades changed something with the assets DLL. Whatever it was caused the performance issue. I deleted and reinstalled the asset and now the Hierarchy is performing much better.

    Asset in question was:
    https://assetstore.unity.com/packages/tools/utilities/qhierarchy-28577

    // WildStyle
     
  14. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,622
    QA replied to the issue and wrote they're no longer able to reproduce it with Unity 2019.3.0b3. I will take a look at it next weekend and report back.
     
    LeonhardP and Prodigga like this.
  15. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,622
    Re-tested with 2019.3.0b3 today. It improved a lot.

    It went down from about 40ms (0a3) to 18ms (0b3). I also tested 2018.4.6f1, where it costs about 9.5ms here.
    • 2019.3.0a3 = 40 ms
    • 2019.3.0b3 = 18 ms
    • 2018.4.6f1 = 9.5 ms

    hierarchy_2019_3_0b3.png

    hierarchy_2018_4_6f1.png
     
    laurentlavigne likes this.
  16. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,117
    Jumping on this thread, isn't 18ms a bit too much? Maybe there is room for more optimization...or is this to be expected with the hierachy view?
     
    Peter77 likes this.
  17. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Thanks for testing Peter. Could you please reply to the last message from QA since this is still an issue?
     
    Peter77 likes this.
  18. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,622
    Thanks for the reminder, bug-report has been updated now.
     
    LeonhardP likes this.
  19. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,622
  20. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Good news, we have a fix and it's on its way to 2020.1 and 2019.3.
     
  21. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,622
    That's indeed good news. Really cool! Looking forward to give it a try :)
     
  22. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,622
  23. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Peter77 likes this.
  24. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,622
    I re-tested it with 2019.3.0f1 today and it's overall way worse than before. It's now so unresponsive, that my game is unplayable in the editor, with "EditorLoop" costing between 80-120ms most of the time.

    "SceneHierarchyWindow.Paint" is still twice as slow as in earlier Unity versions, and on top of that is now another 50ms cost somewhere in "EditorLoop".

    profiler_f01.png
     
    Seb-1814 and SugoiDev like this.
  25. FcsVorfeed

    FcsVorfeed

    Joined:
    Aug 15, 2014
    Posts:
    50
    i think the QA computer must be RTX2080TI,so they can not repeat any Performance issues,
    I think it is very unprofessional to use such a test machine

    why i knows? because i repeat a bug mail, i saw the QA recode a video to me,
    I was most surprised the video show me the unbeliveable speed computer,
    my RTX1080+i7 9700k was like a turtle to him, is titanX or rtx2080+i9?
     
    Last edited: Nov 28, 2019
  26. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,500
    This is the third identical post of this. I would ask that you please don't cross-post or hijack other threads.
     
    siggigg and rastlin like this.
  27. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    The backport landed two days ago and will be in .0f2, I've asked the team to check on your report and see if there was another performance regression introduced in the meantime.
     
    konsic, AcidArrow, BTStone and 2 others like this.
  28. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,622
    Thank you! :)
     
  29. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Thank you!
     
    Peter77 likes this.
  30. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,622
    Tested 2019.3.0f3, but "SceneHierarchyWindow.Paint" continues to be about twice as slow as in 2018.4. In this version the number of GCAlloc's improved/reduced though.

    upload_2019-12-12_6-16-42.png

    As mentioned earlier, performance when playing the game in the editor has worsen significantly. It peaks up to 140ms per frame, which wasn't the case with earlier Unity versions.
    upload_2019-12-12_6-22-32.png

    upload_2019-12-12_6-20-49.png

    Please let me know what I can do to help you find/fix this issue.
     
    Last edited: Dec 12, 2019
    WildStyle69, Grizmu, bjarkeck and 5 others like this.
  31. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,622
    @Unity_Javier sent me an early build of 2019.3.0f4, which comes with various performance improvements. The editor does feel faster than earlier Unity 2019.3 releases, but there are still a few things that should get ironed out.

    I looked at "SceneHierarchyWindow.Paint" again and it improved in 2019.3.0f4, it costs about 12ms most of the time, but also going back and forth between 10ms to 18ms in my tests. Still slower than earlier Unity releases, but closer than the previous beta release.
    upload_2019-12-16_10-46-29.png

    More importantly to me, I no longer seem to be able to reproduce the 140ms spikes! I wouldn't consider this with about 50ms editor overhead solved yet, but a step into the right direction.
    upload_2019-12-16_10-46-50.png


    upload_2019-12-16_10-48-11.png
     
  32. TwiiK

    TwiiK

    Joined:
    Oct 23, 2007
    Posts:
    1,729
  33. Hazneliel

    Hazneliel

    Joined:
    Nov 14, 2013
    Posts:
    307
    Im still observing this issue on Unity 2019.4.8f1
    It is a lot more severe than in Unity 2019.3
     
  34. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,622
    They added the new "Interaction Mode" and "Frame Throttling" option to the Preferences window that improves overall editor UI performance a lot for me.

    Can you try to set "Interaction Mode" to "Custom" and set "Frame Throttling" to 16ms or 33ms and test if it improves performance?
     
    Last edited: Aug 23, 2020
  35. Hazneliel

    Hazneliel

    Joined:
    Nov 14, 2013
    Posts:
    307
    Thanks, unfortunately that doesn't work, tried different values and the editor is very slow. I can also reproduce this issue on Unity 2020.1.3f1

    I actually didn't knew there was a probloem on Unity 2019.3, I was working with this hierarchy just fine, until I updated to 2019.4.8 is when I see this severe lag.
    upload_2020-8-23_0-31-38.png
     
  36. Hazneliel

    Hazneliel

    Joined:
    Nov 14, 2013
    Posts:
    307
    Peter77 likes this.
  37. eovento

    eovento

    Joined:
    Feb 22, 2018
    Posts:
    38
    Thank you VERY much, Sir.
    I was facing this gigantic lag on my hierarchy for a couple of months now, and I also do use QHierarchy.
    Uninstalled it, installed it again, and life is back to normal.

    I also noticed, on QHierarchy preferences, that if you leave "Errors" checked, you get your delay back.
    I don't actually remember if it was checked before uninstalling it. But if anyone is reading now, try unchecking this before reinstalling QHierarchy.

    My Unity version is 2019.4.15, and I believe it's worthy mentioning that I use it on a Mac, and I noticed this bug started happening after updating MacOS to it's horrible Big Sur version.
     
  38. lclemens

    lclemens

    Joined:
    Feb 15, 2020
    Posts:
    761
    I'm using 2022.2.10 and the Entities Hierarchy is unbelievably slow. To be honest, it has always been slow - even when using 2019. Currently, after clicking an entity in the hierarchy, the inspector will take up to 15 seconds to load. Some entities take much longer than others. If I have an entity selected, the FPS during gameplay drops to crawl around 3 FPS.

    This is with Automatic selected in the inspector. Choosing "Authoring" brings the frame rate back up to normal, but of course it prevents me from using the inspector on entities.

    So is this considered normal???

    I am using Odin Inspector (without the experimental entities module)... could that be causing it? Sometimes it randomly gives these errors which have no stack-trace back to any of my code:

    ObjectDisposedException: Cannot access a disposed object.
    Object name: 'The NativeArray has been disposed, it is not allowed to access it'.
    Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckExistsAndThrow (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle& handle) (at <61c05f8d81804e929ff4198c5bcc7a62>:0)
    Unity.Entities.WorldUnmanaged.GetImpl () (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.44/Unity.Entities/WorldUnmanaged.cs:1039)
    Unity.Entities.WorldUnmanaged.get_SequenceNumber () (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.44/Unity.Entities/WorldUnmanaged.cs:957)
    Unity.Entities.World.get_SequenceNumber () (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.44/Unity.Entities/World.cs:180)
    Unity.Entities.Editor.EntitySelectionProxy.GetHashCode () (at ./Library/PackageCache/com.unity.entities@1.0.0-pre.44/Unity.Entities.Editor/Inspector/EntitySelectionProxy.cs:180)
    Sirenix.Utilities.ReferenceEqualityComparer`1[T].GetHashCode (T obj) (at E:/Odin/Sirenix Solution/Sirenix.Utilities/Misc/ReferenceEqualityComparer.cs:37)
    System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <5d4cbfbeb62e454f98e19b231866113e>:0)
    System.Collections.Generic.Dictionary`2[TKey,TValue].set_Item (TKey key, TValue value) (at <5d4cbfbeb62e454f98e19b231866113e>:0)
    Sirenix.OdinInspector.Editor.PropertyTree`1[T].ForceRegisterObjectReference (System.Object reference, Sirenix.OdinInspector.Editor.InspectorProperty property) (at E:/Odin/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:2156)
    Sirenix.OdinInspector.Editor.PropertyValueEntry`2[TParent,TValue].GetValueState () (at E:/Odin/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyValueEntry.cs:1233)
    Sirenix.OdinInspector.Editor.PropertyValueEntry.Update () (at E:/Odin/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/Value Entries/PropertyValueEntry.cs:267)
    Sirenix.OdinInspector.Editor.InspectorProperty.UpdateValueEntry () (at E:/Odin/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:1531)
    Sirenix.OdinInspector.Editor.InspectorProperty.Update (System.Boolean forceUpdate) (at E:/Odin/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/InspectorProperty.cs:1150)
    Sirenix.OdinInspector.Editor.PropertyTree`1[T].get_RootProperty () (at E:/Odin/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:1280)
    Sirenix.OdinInspector.Editor.PropertyTree.InitSearchFilter () (at E:/Odin/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:1067)
    Sirenix.OdinInspector.Editor.PropertyTree`1[T]..ctor (Unity.Entities.Editor.EntitySelectionProxy[] targets, UnityEditor.SerializedObject serializedObject, Sirenix.OdinInspector.Editor.SerializationBackend backend) (at E:/Odin/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:1531)
    System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) (at <5d4cbfbeb62e454f98e19b231866113e>:0)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) (at <5d4cbfbeb62e454f98e19b231866113e>:0)
    System.Reflection.RuntimeConstructorInfo.DoInvoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <5d4cbfbeb62e454f98e19b231866113e>:0)
    System.Reflection.RuntimeConstructorInfo.Invoke (System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <5d4cbfbeb62e454f98e19b231866113e>:0)
    System.RuntimeType.CreateInstanceImpl (System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes, System.Threading.StackCrawlMark& stackMark) (at <5d4cbfbeb62e454f98e19b231866113e>:0)
    System.Activator.CreateInstance (System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) (at <5d4cbfbeb62e454f98e19b231866113e>:0)
    System.Activator.CreateInstance (System.Type type, System.Object[] args) (at <5d4cbfbeb62e454f98e19b231866113e>:0)
    Sirenix.OdinInspector.Editor.PropertyTree.Create (System.Collections.IList targets, UnityEditor.SerializedObject serializedObject, Sirenix.OdinInspector.Editor.SerializationBackend backend) (at E:/Odin/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:1054)
    Sirenix.OdinInspector.Editor.PropertyTree.Create (System.Collections.IList targets, UnityEditor.SerializedObject serializedObject) (at E:/Odin/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:952)
    Sirenix.OdinInspector.Editor.PropertyTree.Create (UnityEditor.SerializedObject serializedObject) (at E:/Odin/Sirenix Solution/Sirenix.OdinInspector.Editor/Core/PropertyTree.cs:904)
    Sirenix.OdinInspector.Editor.OdinEditor.get_Tree () (at E:/Odin/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinEditor.cs:49)
    Sirenix.OdinInspector.Editor.OdinEditor.DrawOdinInspector () (at E:/Odin/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinEditor.cs:224)
    Sirenix.OdinInspector.Editor.OdinEditor.OnInspectorGUI () (at E:/Odin/Sirenix Solution/Sirenix.OdinInspector.Editor/Drawers/OdinEditor.cs:79)
    UnityEditor.UIElements.InspectorElement+<>c__DisplayClass71_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <603bdbf3494743328394e419389d220c>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)

    I'm not sure why the errors say "E:/Odin/Sirenix/..." I don't even have an E drive!
     
  39. lclemens

    lclemens

    Joined:
    Feb 15, 2020
    Posts:
    761
    I uninstalled Odin and commented out all of my uses of it. It's still slow.

    slow-inspector.gif

    Whenever I make the selection, I can watch the CPU jump from 1.5% to 15% and one of the cores gets hammered.

    Here is an example of an entity that is fast when I switch to it (about 1 second to load in the inspector):

    upload_2023-3-13_12-45-30.png

    And here is an example of a slow one (about 8 seconds to load):

    upload_2023-3-13_12-48-8.png

    Is it related to number of components? DynamicBuffers? Blob Assets?

    I'm not sure what to make of this.... DOTS gives us the ability to use tens thousands of 3 dimensional entities with high performance, but it can't update a property tree without bringing the computer to its knees?
     
    BigRookGames likes this.
  40. BigRookGames

    BigRookGames

    Joined:
    Nov 24, 2014
    Posts:
    330
    I've experienced this as well. 5-10 seconds on updating an entity hierarchy.

    Though it seems that the entity view is a bit slower, for me even traditional GameObjects take almost as long to populate in the inspector usually around 5 and sometimes up to 10 seconds. It is quite a frustrating experience and have shifted development to cater to this fact. Would love to hear from Unity on this if there is anything to relieve this duration, or even what might be causing it to be aware of how potential additions may impact editor performance while development.
     
    lclemens likes this.
  41. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,081
    Still no solution for this? Editor behaviour is very erratic, sometimes the lag is acceptable other times it slow down to 2 FPS.
    It's very hard to understand what's the problem cause, at least in my case, the slow down happens only when I select a game object (that contains a script with several visible variables) but not when I select other game objects with even more complex scripts.