Modules in C++ have the potential to significantly speed up building Chromium. With textual inclusion, many headers are re-parsed over 35000 times and with modules could be reduced to the order of 10 times.
Clang supports two types of modules: Clang header modules and C++20 modules (also called Clang Modules and Standard C++ Modules). We're currently exploring Clang header modules because:
We're currently enabling modules for libc++ and they can be enabled with the GN arg use_clang_modules
.
Clang modules don't play nice with code with RTTI / exceptions depending on code without, and vice versa. Work is ongoing to fix this, but for now, it remains a problem (crbug.com/403415459).