Editor pauses for 20-30 seconds after exiting play mode

As the title says, every time I exit from play mode, the editor hangs for 20-30 seconds before I can interact with it again. It’s not a game-breaker, just annoying and slows down my iteration cycle.

Another thing that I noticed is that the editor prefabs appear to be restored before the pause. The reason I say that is because I have some prefabs that have editor stand-in geometry, and that geometry gets replaced at runtime. The editor stand-in geometry comes back before the pause.

The project also takes a long time to check for changes on Collab on initial startup. I don’t have much to compare to on that - none of my other projects are using Collab.

The project is very large, with probably over 2000 assets in the Assets folder, not including scripts. Probably somewhere around 50k lines of code. I would write this off as being the problem, but I have other projects just as large that don’t pause like that, and all of those assets are spread out over a lot of scenes, so the scenes themselves aren’t very large. It’s for the Oculus Quest, so the platform is set to Android.

Editor version: 2019.1.2f1
Operating system: Windows 10 (latest version, IT department just updated it)
Processor: i7 3.6G, quad core with hyperthreading (task manager shows 8 logical cores)
Memory: 32G
System drive: 256G SSD
Video card: GeForce GTX 1080 Ti
Project drive: another 256G SSD

All hard drives have at least 10% free space.

Anyone have any idea what the problem is?

When you enter Play mode, the Editor takes all open scenes and writes them to a temporary location on disk. When you exit Play mode, the Editor first unloads all open scenes, then loads all scenes previously saved temporarily to disk. This is how Unity allows you to enter Play mode with scenes having unsaved changes without losing them, and how the Editor keeps you from editing the scene while in Play mode.

Depending on the performance of your computer, especially the SSD, and the size of all these scenes and any assets they reference, this process can be really fast or it can take quite a while.

Thanks for the reply.

I guess as long as nothing is broken, I can live with it. That was my main worry. I wonder, though, if it could cache scenes as needed instead of all of them. Yes, I know, it would make scene changes slower in the editor, but maybe an option? Just a thought. Or maybe that’s what I get for doing huge projects like this. :slight_smile:

I did notice that my other computer, which is significantly faster (SSD benchmarks at 3.5G/s) also does it.

1 Like

You could also try using the profiler to see what’s taking the time. Make sure to select “Profile editor” option.