~/talk

C++ #include on a Diet

Talkat ACCU 2024 · 2024-04-17..04-20· [c-and-cpp]
links:none on file
slides:none on file

Large legacy C++ codebase (≈3.5M LOC, ~180 Visual C++ projects, 60,000 #includes in .cpp files) undergoes automated pruning by iteratively removing each #include, recompiling with cached Clang command lines produced via Clang Power Tools, using precompiled headers and file-level parallelism; outcome is 34% reduction (≈20,000 includes removed, ~3 removed per touched .cpp across ~4,000 files), a ~5% build-time speedup, and catchable pitfalls like link-time externs and macro-guard variants; future: monthly pipeline and header pruning; alternative tools tried: include-what-you-use and Visual Studio include cleanup.

AI-written summary · about

  1. 0:00Motivation for header pruning
  2. 8:56Defining the problem
  3. 12:02Evaluating potential strategies
  4. 26:25Developing the automation engine
  5. 39:27Optimization and parallelization
  6. 42:06Results and lessons learned
~/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.