Hacker News new | ask | show | jobs
by fanf2 623 days ago
This has a good comparison of compile times with unity builds and PCH https://alexanderhoughton.co.uk/blog/faster-compiling-visual...
1 comments

That page correctly mentions what is really happening: the same set of headers was used for all source files, so they were very easy to eliminate either by a single compile process with a shared cache or by having headers pre-compiled. The test header file also contains <windows.h> and <iostream>, which are known to be very large and only sparingly used compared to others, so unity builds were unexpectedly close to PCH in terms of performance here. (Also typical mid-sized C++ projects that benefit from unity builds are not that fast to compile ;-) In any case, the distinction between unity builds and PCH should remain clear.