What is "DisableScriptedObjects" in the domain reload profiling?

I’ve seen some long application reload times and decided to dig into the logs. I found that ReloadAssembly → BeginReloadAssembly → DisableScriptedObjects is taking over 50 seconds! I attempted to Google as much as I could but can’t seem to find any documentation or information that helps me understand what this is telling me. Does anyone know what this means?

RefreshProfiler: Total: 288.427ms
- Completed reload, in 61.200 seconds
Domain Reload Profiling:
ReloadAssembly (61266ms)
BeginReloadAssembly (56752ms)
ExecutionOrderSort (0ms)
DisableScriptedObjects (56439ms)
BackupInstance (0ms)
ReleaseScriptingObjects (1ms)
CreateAndSetChildDomain (195ms)
EndReloadAssembly (4463ms)
LoadAssemblies (192ms)
RebuildTransferFunctionScriptingTraits (0ms)
SetupTypeCache (512ms)
ReleaseScriptCaches (4ms)
RebuildScriptCaches (117ms)
SetupLoadedEditorAssemblies (1061ms)
LogAssemblyErrors (0ms)
InitializePlatformSupportModulesInManaged (3ms)
SetLoadedEditorAssemblies (0ms)
RefreshPlugins (8ms)
BeforeProcessingInitializeOnLoad (284ms)
ProcessInitializeOnLoadAttributes (751ms)
ProcessInitializeOnLoadMethodAttributes (10ms)
AfterProcessingInitializeOnLoad (5ms)
EditorAssembliesLoaded (0ms)
ExecutionOrderSort2 (0ms)
AwakeInstancesAfterBackupRestoration (738ms)

2 Likes

This is a wild guess, and even though it says ‘ScriptedObject’, I wonder if ‘DisableScriptedObject’ is when Scriptable Object’s OnDisable calls happen?

I know that during a domain reload, scriptable objects get their OnDisable calls, then their OnEnable calls (and maybe Awake? Iunno.)

Do you have large numbers of scriptable objects with potentially processor intensive OnDisable calls?

Again, this is just a wild guess.

I went looking through my scripts and couldn’t seem to find any Scriptable Objects that are doing complex work. I’ll keep that in the back of my head though as it’s a really great guess and I could be missing something because my project is very large! Thank you!

I was able to get into the profiler and look at the editor specifically. This looks like it is an issue with PlasticSCM integration in Unity.

I’ve opened up a post on the Plastic SCM forums. Plastic SCM hangs during domain reloading