Add Profile-Guided Optimization (PGO) support
- Dominant language
- Rust
- Stars
- 4.4k
- Forks
- 394
- PR merge metrics
- No merged PRs in 30d
Description
Hi!
Here I want to discuss the idea of adding to Buck2 explicit support for building applications with Profile-Guided Optimization (PGO). According to many [articles and benchmarks](https://github.com/zamazan4ik/awesome-pgo), PGO can play a huge role in an application optimization path. However, performing PGO optimization manually via tweaking compiler flags can be error-prone. That's why I think adding such a feature to Buck2 would be helpful.
Some examples of the current situation in other build systems:
* Cargo: No built-in support but there is awesome [cargo-pgo](https://github.com/Kobzol/cargo-pgo)
* Bazel: Supports ([command-line reference](https://bazel.build/reference/command-line-reference#flag--fdo_instrument))
* Meson: Supports (`b_pgo` in the [docs](https://mesonbuild.com/Builtin-options.html))
* CMake: No support yet ([GitLab issue](https://gitlab.kitware.com/cmake/cmake/-/issues/19273))
* SCons: No support yet ([GitHub discussion](https://github.com/SCons/scons/discussions/4437))
Since Facebook is the main [LLVM BOLT](https://github.com/llvm/llvm-project/blob/main/bolt/README.md) contributor, more native LLVM BOLT integration into the build system pipeline also could be an interesting idea for the Facebook-powered build system.
Contributor guide
Assessment
This issue has not been assessed yet.