Hello Unity Community!
I am trying to get some information on how I could solve an ongoing issue with my project.
Whenever I change a line of code in my project, unity takes just under 3 minutes to rebuild, and another minute and 30 or so to enter the game. This is obviously a serious issue for production and efficiency.
The reason, I suspect, is that I am working on a complex virtual world simulation, and as such, I have a large project folder.
My build size is 12 GB, which seems fine, but my project folder (Including the library, shaders, etc) is about 70 GBs. This is obviously huge, but I can’t really reduce this too much. Most of that data is needed. I could maybe shave off a few GB’s by removing old art assets or unused asset store assets, etc, but it’s still going to be a fairly large project.
I am currently using 2020.1, but I have upgraded this project from previous versions several times. The issue that I am having may be related to this:
So, I am wondering what I can do to reduce Asset Database refresh times?
I have tried adding ASMDEF’s to my project wherever I can, but it seems that most of the issues are not with compiling code, but with the actual Database refresh, which would seem to indicate that unity is refreshing my art assets, is that correct? Why would unity be refreshing art every time a code file is changed, the art is static?
About a year ago, when I first noticed this problem, I moved my unity project to an SSD (Which I bought specially for that purpose), and this did seem to help. I can’t remember how much, but it did make the editor refresh faster.
Could this issue be hardware related?
My computer is quite old, I am running a 6700K and a 980ti, with 32 GB’s RAM, and my main drive is a spinner. Unity, as I said, has its own SSD, but most of my dev programs, etc, are on the HDD.
I am currently buying parts for a new build, and I am getting an AMD 5950x, nVidia 3090, and the fastest 2TB M.2 SSD that I can get (Sabrent Rocket or Gigabyte Aorus, probably). I intend to run my OS, all of my dev programs, and Unity, from the same drive. Would this make a substantial difference?
Could there also be software issues? I have added the unity drive as an exception to my antivirus software, and I have verified that the issue occurs even when a backup is not running, although antivirus and backup programs are still running in the background, could they be conflicting with unity in some way?
When I restart my system completely, Unity often seems to rebuild a lot faster for the first few code changes, then goes back to taking 3 mins again. This seems to point to a software issue?
Is there anything else that I can do to diagnose or improve this issue, or, and this is my real worry, is the size of my project going to guarantee long refresh times regardless of the hardware or software that I am using?
I have tried profiling the editor, but it just confirms that the “Assetdatabase.refresh” is causing the issue. Is there a way to pin this down to a particular asset, of a particular file, that could be corrupt or badly written, that could be responsible?
Thanks for any advice!