[llvm] [CMAKE][llvm-libraries] Add Precompiled Headers option to improve build times (PR #91755)
Ameer J via llvm-commits
llvm-commits at lists.llvm.org
Sat May 11 07:54:19 PDT 2024
ameerj wrote:
> Do you have any data on how faster the build gets with the precompiled headers? I've done some not particularly thorough experiments with clang and curious what you were able to gain.
This specific change has very minimal improvements in build time, since it's serving as a RFC.
Build time improvements can be easily tested by editing the PrecompiledHeaders file, which will recompile all files that include the PCH. Empty PCH build time was around 14m on my system, with the current PCH being closer to 13m.
With a very hacked up PCH implementation I was able to get close to 1.8x build time improvements.
But I didn't want to invest too much time cleaning up the Frankensteinian PCH impl in case the whole idea of PCH was to be shot down by the maintainers here.
> Why don't you just use modules?
Looks like CMake 3.28 introduces support for [cxxmodules](https://cmake.org/cmake/help/latest/manual/cmake-cxxmodules.7.html).
@adrian-prantl any idea on how involved it would be to integrate the modulemaps into generic CMake cxxmodule support?
https://github.com/llvm/llvm-project/pull/91755
More information about the llvm-commits
mailing list