The benefits / disadvantages of unity builds?

Very similar question and good answers here: #include all .cpp files into a single compilation unit?

The summary seems to be that less I/O overhead is the major benefit.

See also The Magic Of Unity Builds as linked in the above question as well.


It's because it saves redundant work. Redundant parsing and compilation for dependencies. Linking is also much more complex -- you either have your exports all in one object (or a few), or it's separate redundant exports across most of the target's object files. Fewer objects result in less I/O and reduced link times. Depending on your setup, inclusion could be a problem -- on the "unity build" system I use, the build is ultimately CPU and/or memory bound.


Lee Winder posted his experiences with the Unity Builds - The Evils of Unity Builds

His conclusion is:

Unity builds. I don’t like them.