Brussels / 31 January & 1 February 2026

schedule

(clang-)Tidying up includes in systemd


This year, systemd had a breakup with its bad practice of including unused headers all over the codebase. This resulted in:

  • A 33% speedup in from scratch build times
  • A 50% reduction in runtime for our build test CI jobs
  • Thousands of lines of code removed from the codebase

I'll present how I went about this work, using clang-include-cleaner, clang-tidy and ClangBuildAnalyzer, and including the challenges I faced:

  • A scalable way to organize source to minimize unused headers
  • Macros
  • Different build configurations which change the used headers in a source file due to #ifdef conditionals
  • Missing features in clang-tidy and clang-include-cleaner (and my contributions to LLVM to implement those)

https://github.com/systemd/systemd https://github.com/llvm/llvm-project github.com/aras-p/ClangBuildAnalyzer

Speakers

Daan De Meyer

Links