Reload script assemblies take a long time even if it is a new project

I found that reload script assemblies took a lot of time after the project modified the code. To verify the problem, I created a new empty project and created a new script to test, It’s still take a long time (2s~5s).

test in 2021.3.10

I remember clearly that in the previous version, when you had very few scripts, you could compile the code very quickly and not so slowly

I dont know why I cant link this video .

Does anyone care about this?

They do, but this topic has been discussed to death and everyone has long since been aware that 2021 and 2022 are reasonably slower than 2020 and 2019.

There’s a 9 page thread stickied in the scripting forum about it: https://discussions.unity.com/t/859030

In short, remove all packages you don’t need, use assemblies, and don’t load your project to the gills with plugins if you can help it.

1 Like

And one last thing mentioned in that giant sticky thread, that may or may not help you, but definitely sped up my end, is that you can disable directory monitoring and asset refresh. Again, this may or may not help your specific case, but it sure as hell sped things up big time on my end.

gl

Asset refresh on my end (amongst other things). This isn’t a long wait, it’s restart Unity and lose work because I’m not saving every 30 seconds - how do you disable this?

8582293--1149919--upload_2022-11-13_11-19-12.png

@davidnibi Not sure, but there seems to be some relationship between this blocking behavior and debugging with a breakpoint switching back to Unity. I see it most often when I have a debugger attached and I am flipping between Unity and Visual Studio. Is this at all similar to your scenario?

that point is that is a empty new project.

Doesn’t disqualify my points/advice.

Yeah, it’s when both are open. It could be, but I don’t think Unity’s developers know anyway.
I’m really concerned as it is now hanging my PC at times, and I’m having to hard reset - I’ve lost work, and some of my save files have been corrupted, including my project/scene files. It’s become impossible to continue.

This is my current project load screen, and (desperately) trying to backup my project as a package … doesn’t look hopeful does it?
8586298--1150711--upload_2022-11-15_0-11-16.png

8586298--1150714--upload_2022-11-15_0-12-20.png

8586298--1150717--upload_2022-11-15_0-20-2.png

@davidnibi It never resolves for me, and I have to kill the Unity process in task manager. Happens about five to ten times a day on Unity 2022.1.20f1.