The Hitchhikers guide to faster builds
summary
Claim: large C++ projects balloon compile time (Opera 15 → 64 minutes), costing ~\$10,000 per developer per year and ~\$3M for 100 devs. Practical fixes and tools named are unity builds (reported 5–20× speedups but risk ODR issues), precompiled headers (useful for huge headers like Boost Geometry producing ~10MB preprocessed output), and include-what-you-use plus caches and distributed systems (ccache/sccache, SAP CC gave WebKit 2–5× faster builds, ninja and Incredibuild for parallel scheduling). PGO, lld/gold, pimpl and external templates also appear.
AI-written summary · about
chapters (41)
- 0:00Intro
- 1:04Reality
- 1:41A unique problem to C++
- 2:44The steps in building C++ code
- 3:16Why C++ compilation takes so long
- 7:18Debug vs Release - the most obvious
- 7:49Unreachable (dead) code
- 9:30Declarations vs definitions - functions
- 10:22Declarations vs definitions - types
- 12:29PIMPL - pointer to implementation
- 13:47PIMPL - pros & cons
- 14:57Abstract interfaces & factories
- 20:04Unity builds - pros
- 23:53Unity builds - how to maintain
- 24:39Inlining annotations
- 26:21Templates-argument-independent code
- 27:48Templates - C++11 extern template
- 29:14Templates - move functions out of headers
- 30:12Templates - cost of operations
- 30:55Templates - other notes
- 31:20Templates - tools
- 32:48Diagnostics - compilation
- 33:40Diagnostics - binary bloat
- 34:55Parallel builds
- 36:52Meta build systems
- 37:52Diagnosing/monitoring parallelism
- 38:28Sort-of winners (in terms of speed)
- 40:12Static vs dynamic linking
- 40:43Dynamic linking - symbol visibility
- 41:31Multiplatform symbol export annotations
- 42:58Linkers - LTO and other flags
- 43:43Compiler caches
- 46:01Distributed builds
- 47:25Hardware
- 48:07Physical design
- 50:18Dependency analysis
- 51:22Modules - history
- 53:00Modules - VS 2017 example
- 53:36Modules - how they work
- 54:17Modules - the current state
- 55:41Next steps
related talks
56mPractical Techniques for Improving C++ Build Times
53mReducing C++ Compilation Times Through Good Design
53mWhy Is My C++ Build So Slow? Compilation Profiling and Visualization
01h 44mImproving C++ Compilation Times: Tools & Techniques
05mHow To Profile Compilation Duration?
23mtoolchain-agnostic build time improvements
35mHow we brought down our build times. Modularization impact on build speeds and metrics
46mDeveloper Productivity at Scale
