Extremely slow entering play mode in the LATEST Unity 2022 (3.22.f1)

I upgarded my project from 2022.3.0 to 2022.3.22.f1

In the 2022.3.0 I got 35 seconds to enter play mode FIRST TIME
after this I got an average 20 seconds entering play time

after the update:

In the 2022.3.22f1 I got 16 seconds to enter play mode FIRST TIME
after this I got an average 15-20 seconds entering play time

BUT

if I edit something on the scene in the new unity (lets say I move a little left a gameObject, and save the scene) I got 01:40 to enter play mode again and again.

If I exit unity and reopen, I got again 15-16 seconds to enter play mode…

What is the issue? How can it be fixed? 100 seconds is a little nightmare for me.

Hell, even 20 seconds entering playmode is gruesome! :hushed:

First, there’s “disable domain reload” detailed here: Unity - Manual: Configurable Enter Play Mode
This makes enter playmode nearly instant in a new project. You have to check the statics though but that isn’t a big deal. You may be able to leave domain reload on and just skip the scene reload part, this may already give you a speed boost.

Otherwise: open profiler, set it to edit mode and enable deep profiling. Then enter playmode, see where all the time is spent. You may be loading a large amount of assets, or your scripts may be doing a lot of work in Awake/OnEnable/Start (or just very game objects running just a little bit of code).

20 seconds is why gruesome? It is a very big map.
On a NEW scene, where there is nothing lets say just 500 cube without any material, in unity 2022 entering play mode is 4-5 seconds. I know domain reload stuffs, but the same. :slight_smile:

With domain reload disabled in a new project playmode is instant in a new project, maybe 0.2s at most. Without it, it’s 3-4s for me.

20s is gruesome because this totally kills iteration workflow. It may be a big map, but why then is it not chunked into smaller fragments?

I always mind the enter playmode time, so any time something happens that bumps it noticeably, I investigate. There is typically just one thing that causes the slowdown, and often it can simply be disabled during development.

Unity will serialize/deserialize the scene when you enter/exit play mode. If a tiny scene is working just fine but a big scene isn’t you might be running low or out of system memory which will cause the storage drive to be used in the place of memory and that’s orders of magnitude slower. What’s your computer’s specs?

You may also try to disable Windows Defender (or add your project folder and Unity folder to exclusion list) if you’re under Windows.

i7 11k 48 GB RAM, RTX 3070
WIN 11

I dont know but on Unity 2022.3.0 LTS it was (fixed by me yesterday) with domain reload 12 sec, withut it it was 4-5 sec.
But in the latest version it is 100 sec :smile:

It was a script, I fixed it. A custom terrain generator.

Now on Unity 2022.3.0 LTS it was (fixed by me yesterday) with domain reload 12 sec, withut it it was 4-5 sec.

But in the latest version it is 100 sec if I move something in the scene and save/or just not save.

After this always 100 sec . Restart and again 12 sec :smile:

needle-tools/compilation-visualizer: Unity Tool showing a timeline of assembly compilation. This is especially helpful when trying to optimize compile times and dependencies between assemblies. Besides showing a graphical view of compilation, selecting an assembly shows both dependencies and dependents of that assembly. (github.com)