Evaluate using Profile-Guided Optimization (PGO) and LLVM BOLT for CMake
Hi!
Recently I checked Profile-Guided Optimization (PGO) improvements on multiple projects. The results are here. E.g. PGO results for LLVM-related tooling are here. According to the tests, PGO helps with achieving better performance in many software domains. That's why I think trying to optimize CMake with PGO can be a good idea. We have the large amount of CMake scripts with non-trivial logic inside, so optimizing CMake probably could help with optimizing our CMake-times.
I can suggest the following action points:
- Perform PGO benchmarks on CMake. And if it shows improvements - add a note about possible improvements in CMake performance with PGO.
- Providing an easier way (e.g. a build option) to build scripts with PGO can be helpful for the end-users and maintainers since they will be able to optimize the CMake according to their own workloads.
- Optimize pre-built binaries
Testing Post-Link Optimization techniques (like LLVM BOLT) would be interesting too (Clang and Rustc already use BOLT as an addition to PGO) but I recommend starting from the usual PGO.