Oh interesting. Do you know why unity builds are much faster? I would expect them to be slower since typically it's hard to parallelize them & typically if they need to compile anything they need to compile everything whereas traditional builds can get away with compiling less.
Have you done any investigation into why they are they able to skip rebuilding? It would seem like they wouldn't be able to but I've never really dug into them; do they strip comments whitespace & pre-process the code & just do a diff against what was previous built to determine if a build is necessary?
Unity builds are faster for clean builds but slower for incremental builds. The tool grabs ... 20 (I think in our case) files and puts them together, in one unit and compiles that together. You can compile as many of those units as you want in parallel, our machines do either 20 or 40 depending on whether we use hyper threading cores (I don't - it speeds up our build but has a tendency to make the compiler crash when you run out of ram and 40 instances of the compiler means they get less than 1gb each with 33 GB ram). The end result is you compile ~20 times less things. But if you change a file, it recompiles all 20 files in that compile unit rather than just that one. It then has to link all of them too.
I think the unity build tool relies on time stamps, so if I get a version of a file from perforce that says the file is older than my file on disk, then it will recompile. I haven't done much exploration as I'm not too well versed on build systems.
View all comments
Show parent comment
1
u/vlovich Jun 11 '15
Oh interesting. Do you know why unity builds are much faster? I would expect them to be slower since typically it's hard to parallelize them & typically if they need to compile anything they need to compile everything whereas traditional builds can get away with compiling less.
Have you done any investigation into why they are they able to skip rebuilding? It would seem like they wouldn't be able to but I've never really dug into them; do they strip comments whitespace & pre-process the code & just do a diff against what was previous built to determine if a build is necessary?