← all posts site ↗

pressing play in unity still feels slow

the delay between pressing play in the unity editor and the game actually starting is almost always one of three phases: script recompile, asset import, or work happening in the awake function. i had already turned off domain reload and scene reload in the play settings, which made things faster, but it still felt a beat slow, and those two settings do not touch the other two phases at all.

the surprise suspect was the asset import pass. turning domain reload off does not skip importing. anything that changes under the assets folder while the editor is open triggers a full import on the way back into play mode, and play waits for that pass to drain before the game starts. my blender-to-unity pipeline writes model exports straight into assets, so any external drop paid the tax. the test is simple: press play twice in a row without touching anything. if the second press is fast, the first one paid the import tax. if both are slow, it was never compilation, it is awake and startup work.

reading which one: watch the status text in the bottom right corner of the editor. if it shows importing or scanning before the game view appears, it is an import pass. if it jumps straight to the game view but still takes a beat, it is startup code. the editor log has the play marker and the first awake timestamp, and the gap between them is pure startup time.

the fixes: stage model exports in a folder outside assets and copy them in when the editor is closed, so play mode never pays the reimport tax. for startup work, log each step of the awake function with the real time since startup value and find the slow line. repeated plays with no changes should be near instant, and when every play is slow even with nothing changed on disk, the answer was never recompilation.