[Unity] Unnecessary RuntimeManager.OnGUI() performance hit?

#1

RuntimeManager implements the Unity OnGUI() method hook to present the FMOD debug overlay. This can be disabled through the plugin settings inspector, but this won’t affect Unity’s registration of the method, which is called as needed by the engine.

I have observed a significant, periodic spike of approximately 4ms in a frame due to GUI garbage collection that appears to be attributed to this method. When removed, the related spikes no longer appear in-editor nor in build.

Has this been observed in other users of the plugin? As in intermittent solution, we have enclosed the method in #if UNITY_EDITOR, but would prefer not to modify the plugin source.


For context, our project is a VR game, with no other OnGUI() usage.

The OnGUI() implementation can be found in the FMOD codebase here:

#2

Agreed, we ended up commenting this out but should probably not be using onGUI especially for mobile or VR platforms.

#3

This has been changed in the upcoming release (1.10.13 & 2.00.01) to remove any unnecessary garbage collection when disabled.

1 Like