4 ms·
Unfortunately this isn't consistent with how these terms are typically used. This article only explains the simple case where your program is small enough that
by dmazzoni 2y ago
Unfortunately this isn't consistent with how these terms are typically used. This article only explains the simple case where your program is small enough that you can compile all source files at once. That's not realistic or practical for much larger projects.
Both WebKit and Chromium support unity/jumbo builds. They combine around 20 source files at a time into a single compilation unit, which provides a reasonable tradeoff - making the full build noticeably faster without overflowing RAM and without making the cost of recompiling after a single change too large. You also get lots of parallelism.
Making a unity / jumbo build work for a project with 10,000+ files and millions of lines of code is not simple at all.
- npalli 2y agoMaking a unity / jumbo build work for a project with 10,000+ files and millions of lines of code is not simple at all. True, but the number of such large projects is tiny (< 100?) compared to the tens of thousands of other smaller projects that might benefit. Good writeup.
- cpeterso 2y agoFirefox uses “unified” builds, concatenating .cpp files only within each directory. Unified Firefox builds are about 2-5x faster on my Mac. Non-unified builds are still built to make sure there are no unexpected side effects or accidental header file dependencies. https://firefox-source-docs.mozilla.org/build/buildsystem/unified-builds.html https://firefox-source-docs.mozilla.org/build/buildsystem/un...
- omoikane 2y agoFirefox's unified build was discussed here: https://news.ycombinator.com/item?id=35825683 https://news.ycombinator.com/item?id=35825683 - Unity builds lurked into the Firefox Build System (2023) The page that was referenced by that thread has moved, current location is https://serge-sans-paille.github.io/pythran-stories/how-unity-builds-crept-into-the-firefox-build-system.html https://serge-sans-paille.github.io/pythran-stories/how-unit...
- saagarjha 2y agoWebKit calls them that too.
- almostgotcaught 2y ago> Chromium support unity/jumbo builds used to https://groups.google.com/a/chromium.org/g/chromium-dev/c/DP9TQszzQLI https://groups.google.com/a/chromium.org/g/chromium-dev/c/DP...
- StellarScience 2y ago> Making a unity / jumbo build work for a project with 10,000+ files and millions of lines of code is not simple at all For years we rolled our own unity build, but now CMake supports it directly through CMAKE_UNITY_BUILD and CMAKE_UNITY_BUILD_BATCH_SIZE, making it straightforward to enable. When first enabling it on a large project, you'll run into clashes where different files contain identically-named file-scoped function or variables. Sometimes this reveals copy-pasted code, where the fix is to refactor the duplicate code anyway. Other times you just pick more specific names to avoid the clash. We find unity build gives a solid 3X build speedup. We haven't eliminated header files, and in fact keep one slow CI job building the code without unity to ensure our code still builds either way.