Compilation Speedup Using C++ Modules: A Case Study
summary
A modularized real project is built and measured with clang and a hand written makefile; demo builds show up to about 4× speedup at -O0 and an average around 2×, while the unit-test build shows under ~10% improvement in many configurations. An implemented function reduction optimization and use of single-thread LTO further cut compile time without consistent runtime regressions; a simple HTTP server benchmark reports comparable or slightly higher QPS after tuning import thresholds.
AI-written summary · about
chapters (16)
- 0:00Introduction to modules
- 2:19Understanding module usage
- 5:54Compilation speed theory
- 8:18Impact of optimizations
- 12:01Inline functions and templates
- 14:15Case study setup
- 17:55Measuring compilation time
- 21:07Experimental results
- 23:11Analysis of results
- 25:50Module composition impact
- 27:10Function reduction
- 30:28QPS and performance tuning
- 33:28Future improvements
- 35:15Library optimization strategies
- 36:42Template instantiation trap
- 39:26Long-term outlook and Q&A
related talks
01h 08mC++20 Modules, 5 Years Later
01h 06mImplementing C++ Modules: Lessons Learned, Lessons Abandoned
51mBoosting Software Efficiency in C++: 100% Performance Improvement in a C++ Embedded System
01h 00mJust-in-Time Compilation
01h 05mThe Speed Game: Automated Trading Systems in C++
38mStrategies to speed up build iteration, or dynamic hot reloading
01h 08mA Short Tour of C++ Modules - Modules Demystified and Applied
32mOptimizing Away C++ Virtual Functions May Be Pointless
