~/talk

Why Is My C++ Build So Slow? Compilation Profiling and Visualization

links:none on file
slides:none on file

Build slowness turns on specifics: Clang’s -ftime-trace produces per-object JSON showing front-end vs back-end time, Ninja emits a ninja log that ninja tracing converts into Chrome trace format, and perfetto lets SQL queries answer “how much time does iostream or boost cost us.” Example hotspots: iostream inflates a simple file to ~3MB of preprocessed text, huge template instantiations can generate ~33,000 lines, and precompiled headers can hurt parallelism (1.91s → 1.16s when used right, but sometimes slower because of blocking).

AI-written summary · about

  1. 0:00Build speed motivation
  2. 1:49Speaker overview
  3. 10:20Visualizing with Ninja and clang
  4. 11:44Includes and headers
  5. 16:01Templates and metaprogramming
  6. 20:15Translation units and dependencies
  7. 23:05Precompiled headers and modules
  8. 27:21Dependency bottlenecks
  9. 29:31Include paths overhead
  10. 32:20Advanced profiling with perfetto
  11. 33:47Optimizing build process
  12. 35:53Hardware limits
  13. 38:22Takeaways and call to action
  14. 39:25Q&A
~/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.