“Deploying C++ modules to 100s of millions of lines of code"
summary
Google migrates hundreds of millions of lines of C++ to Clang modules and header PCM files, using module maps and a changed protoc generator to modularize protocol buffers and reduce reparsing. Average compile time improves ~10% with up to ~50% gains in the 99th percentile, but naive rollout doubles distributed-build load because more module inputs force extra staging and recompiles. Fixes include ~10k header repairs, modularizing STL dependencies, include-scanning for modules, and splitting libraries; the approach works but exposes new build-system and tooling costs.
AI-written summary · about
chapters (11)
- 0:00Introduction to Google C++
- 2:54Google build system basics
- 6:06Motivation for C++ modules
- 8:10Analyzing slow build causes
- 12:25Modules implementation plan
- 13:56Modules versus traditional builds
- 17:02Rolling out modules for protox
- 22:12Technical challenges and fixes
- 31:41Initial rollout results
- 38:01Optimizing the build process
- 40:57Lessons learned and conclusion
related talks
01h 01mC++ Modules and Large-Scale Development (Part 1)
01h 07mBuilding C++ Modules
58mSo, You Want to Use C++ Modules … Cross-Platform?
01h 00mSo, you want to use C++ Modules ... cross-platform?
01h 30mC++ Modules and Large-Scale Development
34mPractical C++20 Modules and the future of tooling around C++ Modules
59mC++ Modules
01h 30mC++ Modules and Large-Scale Development
