scriptable objects slow down the editor

We have an issue with scriptable objects slowing down the editor massively. They are only used as data containers and as such has no actual logic in them. The thing is that the c# script doesn’t cause any issues, it’s only the instances of the scribtable objects that does. If we delete all instances (Roughly 80), the editor runs fine again.

The slow downs that it causes:
Without the scriptable objects, the compile time is 20 seconds, with them it is 50 seconds. They add consistentlty 30 seconds of compile time. (This is not the main issue).
Without the scriptable objects, unity is rather responsive, with the scriptable object whenever unity loses focus and regains it, it is frozen for 6-10 seconds. This is the main issue. I’m a little uncertain if the scriptable objects causes it or if the compile time does.

Does anyone know why this might happen?

hello,

A bit of a late reply, but you said it slows down the editor, do you mean it slows down usage of the editor or that it slows down debugging?

if it slows down debugging on start, that’s because all of the Scriptable objects need to be read in from the harddrive. if i have my facts straight on Scriptable Objects, one of the big features is that they automatically handle serializing and saving themselves. that means they exist in some way as files on the harddrive. Accessing them for the first time will require harddrive reading.


if its used in say… a gizmo, that will be more severe as i believe unity will attempt to read the scriptable object from the harddrive each time it tries to access it while the game isnt playing. to fix this, you can cache the scriptable object in your gizmo class and it should stay in memory.