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.
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?
Answer by crare · Oct 10, 2021 at 07:55 PM
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.
Answer by Waffle1434 · Jan 13 at 05:50 PM
Restarting Unity Editor fixed this for me. Very silly. I went from a 40 seconds compile/reload script assembly time, to <2s.
Answer by Borjka · Jul 07, 2021 at 11:47 AM
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
Answer by macagu · Jul 13, 2019 at 08:05 PM
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 did some research and ended up writing a post about it with my findings: https://gamejolt.com/games/talesofkulplex/313193/devlog/tales-of-kulplex-devlog-6-attempting-to-decrease-compile-times-she9y7qf
But basically, you gotta split the project into assemblies and try to reduce the number of files in the project.
I second the restarting of Unity. I tend to keep it open for many hours to many days at a time.
I didn't have to reimport all - but after restarting I went from 4.8s to 1.6s. I'm on a beast of machine with 64 gb of ram and 8 cores and none of it was being stressed in the slightest. So there's something else that's causing Unity to get slower and slower over time.,I noticed that if I keep Unity open for awhile (ie. many hours to days) it will get slower and slower. I restarted Unity and my Assembly Reload Time went from 4.5s down to 1.6s.
I'm not sure why tho... it's not memory tho - I'm on a beast of a machine with 64gb of ram and it wasn't even using half of that and 8 cores.
Breaking up your assemblies should also work but it can be a lot of work as you may need to refactor a crap load of stuff so that the dependencies make sense.
Your answer

Follow this Question
Related Questions
Game gets slower for certain resolutions in Unity Editor. What could be possible fix? 0 Answers
Alternative to EditorWindow.OnDisable to run before compiling 2 Answers
Script work perfectly in Editor but not in build. 0 Answers
projects corrupted: Copying assembly.....UnityEngine.TestRunner.dll' failed 2 Answers
Passing boolean value as argument to OnClick Method? 0 Answers