Quick answer: Godot 4 custom ResourceFormatLoader running scan synchronously, blocking startup for 30s on large projects? Move scan to a background thread or limit per-frame scan budget.

Custom loader for .data files. Startup spinner shows for 30 seconds while it walks 10k files.

Defer the scan

Schedule the scan via WorkerThreadPool.AddTask. Editor starts; loader registers; scan continues in background.

Index incrementally

Each editor open scans only files modified since last scan. Diff-based; near-instant after first scan.

Cache results

Persist scan results to .godot/cache. Subsequent opens read the cache; rebuild only on invalidation.

“Custom loaders run at startup. Synchronous loaders are user-visible startup cost.”

If you author Godot plugins, async loading is mandatory for any non-trivial scan. Startup is too visible to block.

Related reading