GetComponentNullErrorMessage freezing game for seconds

We want no more of this for GetComponent invisible messages, that havent a component, taking so much memory and slowing the game within the Editor it freezes the game for seconds while I made all the null checks so it logs a million messages somewhere and no idea where as there is no log message in the Log Panel, plus no possibility to disable that. Unity 2022.3.8f1 (LTS), plus I have to rewrite all my getcomponent lines then ? come on Unity where can we just disable that stuff???

Try upgrading to the latest 2022.3.53f1. That’s about 45 patch releases you’re missing out on currently! This issue could have been known and since fixed.

There were editor performance regressions in the early 2022.3 patch releases if I recall correctly. As always, you should keep upgrading the early patch releases until around 30f1, and always try the latest patch if you run into odd, inexplicable issues (the other option in such cases is to delete the Library folder).

If after upgrading the issue persists, at least you know you may have to investigate further. Does this only occur when you select a specific object in the scene hierarchy? If so, this might be some Inspector drawing code that makes these calls. If you have a list or array in the Inspector with hundreds of items, fix that (don’t serialize them or don’t add this many items) because this will always be slow.

Enable “deep profiling” to see more of the callstack in the profiler, it may help to find the source.

thanks I’ll try to search for getComponentNullErrorMessage in the revisions logs. As my project is already 60 Gb and takes a very long time to start on a new Unity version, i need a chirurgical target to be sure of the version correcting this. Thanks for the suggestion and infos!

No surprise! :exploding_head:

In any case, you can always make a copy of the project in a coffee break. Then open that copy in the latest version, another break. Then the issue is either gone or isn’t after a quick test.

Thanks for the reply! But…Sure, if my coffee break lasted several hours he he (that’s how long it takes to open my project the first time i use a news version :q really time consuming and frustrating)

You definitely moved your project in a bad place adding 60 gigs of assets to it. Of course this is relative to the machine you are working on, any Laptop even high-end will not nearly perform as well as a desktop, and a spinning magnetic drive of days past (or even a cheap and pretty full SSD), and so many things more. Meaning a hardware upgrade may also help respectively a project of this size demands an i7 or i9 with lots of memory and high speed SSD.

You may want to clean up and remove any unused assets. There are tools like Asset Hunter that can do this for you.