Clicking on the top bar of an MB component results in a long freeze of the editor. The stack trace shows that unity is doing huge amounts of work on click. Is there a way to reduce this?
Almost 300ms on a Ryzen 2700x all to InternalEditorUtility.SetIsInspectorExpanded(). Is there a way I can reduce this in my project and is it possible that this can be fixed?
I’d be more than happy to try to replicate on a different version to help you track this down!
Maybe it was worse pre-2019.2, I could potentially profile 2019.1 in the same situation and see if this is an improvement there. Either way it’s still a hang on 2019.3
Thank you! The best way to help would be to file a bug with a repro project. In cases like this the key factor is scripts/packages setup - the attributes extractions and type comparisons are slow here and we need a real usecase which provides the measurable timings we can improve.
I have submitted a report under the email cian@brightrockgames.com. The report contains only the scripts and plugins folders of the projects, I’m guessing assets are not relevant. I really hope this real-world case is helpful for investigating this
(Case 1240523) Monobehavior Inspector does huge amounts of work when collapsing/expanding components
Out of interest why does expand/collapse require such heavy work? It’s something that if it wasn’t so terribly slow I would click on very frequently so having it be so slow is pretty frustrating.
The Unity QA Team declined the ticket, I’ll see if it can be reopened.
Not cached data about components augmentation - various attributes or editors change the look of the inspector and acquiring this info is expensive (usually reflection).
Thanks for the help - the issue had been fixed as a part of another bug and your project helped to verify it!
I think it was a 2020 version. Maybe just make a bug report, the scripts were what was needed to replicate for me so I dropped them all into a new proj