Drawing cost ~1ms every frames in iPhone build

Hi,

What title says. Checking profiler on iPhone build, I see Aline does not only cost 15ms at Awake, but continuously costs .5 -> 1ms (sometimes more) every frame (under Camera.FireOnPostRender. It’s called “Retained Gizmos” and only Aline has that term).

Why does a debug tools need to run in build version?

Rgds,
Hai.T.Nguyen

Hi

You are right that there were some cases where rendering code wasn’t as aggressively compiled out in standalone builds as it could be.
I have improved this for version 1.3.1 which will be released in a few days.

1 Like

Hi! Sorry for the necromancy, but this happens to me also (v 4.3.39), is there any way to remove it completely from the release version of the project?

Do you happen to have a profile of this? (both deep and non-deep)

Sure:

Editor

Editor deep profile

Release

Seems not much, but also seems to escalate with the number of entities that I have in the level. Thanks!

Aha!
There was indeed a missing #if UNITY_EDITOR there.
So it seems you have a really large number of objects. The only thing that ALINE is doing during your frames is to go through each object and check if it is destroyed or not. However, the MonoBehaviourGizmos script shouldn’t even register objects for drawing gizmos when outside the editor since gizmos won’t be drawn anyway.

I’ll fix this in the next update.

If you are editing the code you can change the MonoBehaviorGizmos.cs -> constructor to be

		public MonoBehaviourGizmos() {
#if UNITY_EDITOR
			DrawingManager.Register(this);
#endif
		}

Let me know if it works for you.

I can’t edit the code since I use it as an external git package :(, will wait to the new update then, thanks for fixing it!