DrawingManager.RemoveDestroyedGizmoDrawers super slow

Hi,

Recently, I have discovered that DrawingManager.RemoveDestroyedGizmoDrawers is eating up 25% of my frame, which is kinda bonkers.

I lose any ability to play the game with a stable frame rate.

I have tried going through and disabling all the settings I could find regarding gizmos/lines, but some things, like NavMeshCuts, there is nothing I can find to disable.

Is there anyway to disable ALINE entirely?

Thanks!

I ended up having to move the package to my Packages folder, not in the normal PackagesCache, then manually editing DrawingManager.cs to disable itself upon entering play mode.

However, this is just a hack. Obviously, this is not ideal functionality.

Hi

Yeah, that method has been annoyingly slow. It’s surprisingly hard to just check if a bunch of objects still exist in Unity. But I think I have an alternative solution that would have better performance.

Hi

Would you mind trying with a newer version of Unity. It seems like in more recent versions of Unity, the null checking has been optimized significantly and thus this method should be a lot faster.

Hello,
i also have the same problem with our project that the DrawingManager.RemoveDestroyedGizmoDrawers() takes up a lot of time to complete. We updated our unity version to 2022.3.8f1 and are using the beta version 4.3.79. In our project a newer unity version didn’t improve the performance at all.

Any update on this or anything we can do to improve the performance? We aren’t using ALINE at all.

@HanHan Do you think you could post a screenshot from the unity profiler?
I just did some benchmarks, and I really can’t get that method to become slow at all. Even with 5000 objects, each of which only draw a single line, the overhead of that method (about 0.1ms in total) is insignificant to the cost of drawing all of those lines.