Very Long Build Times

Hi,

My current Unity project now has build times at around 4 hours (!!!). I had previously assumed by computer was underpowered or short of memory, but having just upgraded the machine I’ve seen little improvement.

Research on the internet suggests that scripts with non-private fields can cause problems, so I’ve been through my entire source base (over 1MB of code!) making as many things private as possible. Unfortunately that’s had nowhere near enough impact. Most classes still have 3-5 public variables and the scale of the refactoring job needed to remove them would be vast (many weeks of work, at minimum). Even if I did, they’d only be replaced with public functions, which presumably isn’t much better?

What can I do about this? I need to get my build times down since I’m approaching alpha release for the project and need to be able to iterate builds quickly. Or, failing that, at least not have to literally do them overnight!

Any help or tips gratefully received. :slight_smile:

Hi,

You can try exporting your whole project, then creating a new project and importing it into that.

You may have a number of scripts/files that you’ll have to bring in manually.

No guarantees, but it has worked for me in the past cleaning up issues.

Thanks for the suggestion Mike - worth a try… but no luck in this case.

Turns out there’s a Unity bug of some kind. See this Answers page for more info if you’re curious: How Can I Reduce Build Time for Script-Heavy Projects? - Questions & Answers - Unity Discussions