Unity 2022.3.20f1 taking too long after script compilation

Compiling a script results in waiting for EditorApplication.delayCall:UnityEditor.Sequences.SequenceIndexer.InitializeWithExistingData to end. It takes around 1 min and 30 secs to finish.

Has anyone else encountered this behavior?

Look for the 157-reply pinned thread in Editor & General Support

Or the 652-reply pinned thread in Scripting forum.

Or any of the other ten million threads posted about this multi-year-old problem.

Good luck!

1 Like

The SequenceIndexer.InitializeWithExistingData seems to run through all the prefabs in the project to build a SequenceAsset database. If there aren’t any SequenceAssets, no QuickSequenceAsset.index will be created and thus the process will be repeated each time a recompilation happens. If there are a lot of prefabs in the project, this will massively slow down post-compilation reload time.

EDIT: It seems even with the QuickSequenceAsset.index existing, the SequenceIndexer.InitializeWithExistingData function still runs. This is mind-boggling.

1 Like

A bug has been reported and accepted. The issue is up for anyone to see.

I wonder if it’s related to the following issue which still hasn’t been fixed.

1 Like

Never realized there was already a report. Thanks for this.

Yes, it is exactly that! I know mostly what’s happening because I looked through the code. The SequenceIndexer.InitializeWithExistingData function simply runs through all the project’s prefabs after domain reload. It calls .GetComponent for a specific component of that library on every prefab. You can imagine how badly that scales.

The weird thing is that it shouldn’t run that call if a specific file exists, namely QuickSequenceAsset.index.

It should be a relatively easy issue to fix. Shouldn’t take more than an hour to be honest. And it’s package related, which means it’s an update on the package rather than a new Unity version. However, the problem might be more complex if it arises due to a combination of internal Unity stuff and that package.

Out of nowhere today I am facing this problem.
After any Script Changes, it takes around 2 min for the domain reload to complete.