Custom editor super slow even with no draw operations

I have a big class (object has large arrays serialized), and default inspector is totally unusable, super slow and unresponsive.
I’ve done a custom inspector to work on this object with responsiveness, and it worked fine. But now, object has even larger arrays, and custom inspector is getting also super slow.
I’ve tried with just this OnInspectorGUI:

public override void OnInspectorGUI()

and it’s still suuuper slow on scrolling.
Deep profile says the culprit is


, which is executing in background while the object is selected, even when it’s not necessary.
So, is there any way to optimize this custom inspector by saying it not to update unless necessary? I don’t want serializedobject.Update() to be executing twice per frame and wasting more than half second if I won’t be modifying the object.

Thanks for your time!

You just shouldn’t put too much serialized data into a single object. That kind of data do we talk about? If it’s static / configuration data it probably should be stored in a seperate ScriptableObject. Maybe you can break down the data into smaller chunks.

Your question is lacking this important detail and without knowing how much data and what kind of data you have stored in your object we can’t suggest any alternatives.

At runtime if you select an object, Unity has to update the inspector every frame. The inspector always works on the serialized data. So the object need to be serialized once per frame. If you put too much serialized information into a single object, of course it slows down the update of the inspector.