▲ | achatham 3 days ago | ||||||||||||||||
We use c++ modules at Waymo, inside the google monorepo. The Google toolchain team did all the hard work, but we applied it more aggressively than any team I know of. The results have been fantastic, with our largest compilation units getting a 30-40% speedup. It doesn't make a huge difference in a clean build, as that's massively distributed. But it makes an enormous difference for iterative compilation. It also has the benefit of avoiding recompilation entirely in some cases. Every once in a while something breaks, usually around exotic use of templates. But on the whole we love it, and we'd have to do so much ongoing refactoring to keep things workable without them. Update: I now recall those numbers are from a partial experiment, and the full deployment was even faster, but I can't recall the exact number. Maybe a 2/3 speedup? | |||||||||||||||||
▲ | wavemode 3 days ago | parent | next [-] | ||||||||||||||||
How much of the speedup you're seeing is modules, versus the inherent speedup of splitting and organizing your codebase/includes in a cleaner way? It doesn't sound like your project is actually compiling faster than before, but rather it is REcompiling faster, suggesting that your real problem was that too much code was being recompiled on every change (which is commonly due to too-large translation units and too many transitive dependencies between headers). | |||||||||||||||||
| |||||||||||||||||
▲ | tbaeder 3 days ago | parent | prev | next [-] | ||||||||||||||||
Are those actually the C++20 modules or clang modules (-fmodules)? | |||||||||||||||||
| |||||||||||||||||
▲ | bufo 3 days ago | parent | prev [-] | ||||||||||||||||
Were you using pre-compiled headers before? |