C++20 Modules, 5 Years Later
summary
C++20 modules cut compilation work by prebuilding interfaces so repeated preprocessing and parsing are avoided, showing 20–70% faster results in the presenter’s microbenchmarks (50 files: 2.6s→2.1s; 100 files: 10s→3s) and a Boost test rebuild case (200 TUs: headers rebuild 2m10s → modules 39s). Compilers advertise support (GCC 14 / Clang 16 / MSVC), but Apple Clang lags, module artifacts are not portable between compilers or versions, CMake has partial support (3.28+), and package managers remain immature though fetchcontent can work.
AI-written summary · about
chapters (15)
- 0:00C++20 modules intro
- 1:13What C++20 modules are
- 3:01Why modules replace headers
- 8:19Modules speed compilation
- 16:33Fragile dependencies leak
- 21:53Writing a simple module
- 27:15Splitting modules into partitions
- 31:58Compiler and build support
- 35:47Library package challenges
- 41:05Tooling limits and UX
- 45:18Build system experience
- 50:20Scanning module deps
- 52:52Live demo: dep scanning
- 57:06Conclusion and future
- 1:00:19Q&A on modules
related talks
01h 05mModules are coming
44mCompilation Speedup Using C++ Modules: A Case Study
01h 06mImplementing C++ Modules: Lessons Learned, Lessons Abandoned
01h 07mC++20 Modules: The Packaging and Binary Redistribution Story
01h 38mC++20: Reaching for the Aims of C++
55mimport CMake, CMake and C++20 Modules
01h 08mA Short Tour of C++ Modules - Modules Demystified and Applied
01h 02mCMake and the Future of C++
