Hacker News new | past | comments | ask | show | jobs | submit login

It is always faster in all cases from my experience. It should not, but it is. Try.



This is silly. If I’m only rebuilding 1 file out of a 200 file source base, I guarantee the non-unity build will be faster. Just the number of characters I have to tokenize in this thought experiment should be enough to convince. If this isn’t the case then you’re doing some sort of n^2 c++ boost every header includes most other headers shenanigans and you need to stop that rather than doing a unity build.


I've worked with unity builds a lot in my career. Rebuilding a unity module can be 90s-2minutes (plus linking), whereas a single file might only be 3-5 seconds on its own.

The best possibility is if your build system can detect which files have changed and exclude them from unity builds, as this gives you the "slow path" the first time you change a file, but from then on you get the fast path behaviour.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: