~/talk

Reducing C++ Compilation Times Through Good Design

Talkat ACCU 2024 · 2024-04-17..04-20· [developer-experience]
links:none on file
slides:none on file

Build time drops from about 1 hour to 6 minutes by profiling and targeted refactors: use clang -ftime-trace and clang-build-analyzer to find hotspots in ~1,200 translation units, swap Make for Ninja, replace LD with lld or mold, add ccache, remove 500 transitive includes via forward declarations and a compilation firewall, introduce precompiled headers (20% win) and object libraries, and enable unity build judiciously — that cuts overall compile time 4–10× and reduces clang-tidy from ~2.5 hours to ~4 minutes.

AI-written summary · about

  1. 0:00Introduction
  2. 1:13Why compilation times matter
  3. 2:58C++ compilation model
  4. 7:29Quick wins with build system
  5. 11:02Compiler caching
  6. 13:06Case study start
  7. 14:10Profiling with Clang tools
  8. 17:59Forward declarations
  9. 22:52Removing unused includes
  10. 24:56Splitting protocol and implementation
  11. 30:13Object libraries for linkage
  12. 32:16Pre-compiled headers
  13. 37:17Unity build
  14. 47:32Unity build challenges
  15. 49:57Results and static analysis
  16. 51:42Main takeaways and final recommendations
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.