Reloading Assemblies is extremely slow. How to fix that?

I once for all decided to do something about my slow compile time (around 14 seconds).

So, after lots of research, I found a way to benchmark the issue: https://gist.githubusercontent.com/filod/ba1e1522c1821cd24ca1a0c9090eb440/raw/32130f055da95f6ee4cf647aae4a35ea180eeea7/AsmdefDebug.cs

After that, I moved my imported asset folders into the “Standard Assets”, which helped slightly decreasing the compile time but the compilation still takes around 8s.
I tried removing all the unneeded “[InitializeOnLoad]” and removed some built-in packages from the Package Manager, still the same.

137639-image-12.png

How do I decrease the Assembly Reload Time?

It takes 7.6s seconds to reload the assemblies after having added/removed a character in a script. That shouldn’t happen in my opinion…
What else can I do?

Restarting Unity once in a while seems to help. Unity seems to bog down when it’s open for multiple days. This maybe a issue with compiling files or something else buggy in your own code or the Engine. It may also be issue with memory use. Restarting your PC once a day anyway should help in most cases.


Good rule of thumb with any software related: Have you tried turning it off and on again?


If these won’t work, only then I would suggest re-importing all your assets, it might break something so I wouldn’t do that as a first option.

Restarting Unity Editor fixed this for me. Very silly. I went from a 40 seconds compile/reload script assembly time, to <2s.

Got same in 2021.1.1f1 it takes ages to do any changes in scripts or start game, while in UE or CORE it takes less than 1 second, looking forward to switching to UE

Try REIMPORT ALL, and then restart Unity.
I was experimenting an Assembly Reload Time of 8 seconds, and now it went down to 2 seconds.
I guess sometimes, somehow, something gets wrongly catched.
I’m using Unity 2019.1.8f1

I have same problem (Unity 2021.1.7f1)

7 seconds ? Lol
I wouldn’t complain about that
I have a reload time between 30 s and 1 minute every time. This started happening when I baked my vegetation though.
Still, 7 seconds is really not an issue xD

I have a very simple project, 4 classes, simple 2d graphics, etc. In 2019 it reloaded very fast. Now I switced to 2020.3 and it takes much longer. I can see a progress bar reloading some Toolbars, Editor layout, etc. Why is that happening? Only my code changed. I even added assembly definition to make sure unity can recompile this few lines of code I put together in no time.
This really is absurd. I know I can disable domain reload but that is not the point.

my unity takes around 2 minutes to reload script assemblies… and my PC is very clean.

how are you getting <2 seconds…

(I got 8gb ram if its low)

Recompile can be slow if the console is full. Sometimes after a big Debug.Log session, I’ll have 40,000+ lines in the console and Script Assemblies Reload will take up to 3 minutes. Clearing the console resolves the issue. (Unity 2020.3).

Still an issue in 2021.3.1f1, hangs forever on 'Reload Script Assemblies busy for 6:29…infinity)

While the compilation challenge is much bigger I took a slightly different approach as my main concern is quick iteration in play mode.

I’ve created a tool that allows to iterate on code without breaking play session.

It’s done by automatically compiling only what you’ve changed and immediately hot-reloading that into current session.

Disclaimer: it’s paid asset but if of interest link text