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 experimenting with modules for libc++ and they can be enabled with the GN arg `use_libcxx_modules. Using this arg is not currently recommended, due to the limitations mentioned below. It is only interesting to people working on the feature.
With Chrome's Clang plugins turned on, modules perform worse than without modules (crbug.com/351909443).
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).
The configurations issue above can cause unexpected build failures.