Profile-Guided Optimization (PGO) in Rust: unknown parts
summary
PGO in rustc supports instrumentation PGO and sampling/BRS profiles: instrumentation requires an instrumented build and a final build, inflates binaries (sometimes up to 2×) and can massively slow hot loops (ClickHouse cited), while sampling gives ~80–90% of instrumentation’s quality with ~2% runtime overhead if tuned. Tooling: use perf + llvm-prof converters but BRS (LBR) availability and virtualization are spotty. Practical tips: enable LTO before PGO, use cargo-pgo, commit profiles to VCS for reproducible builds, and consider Yandex Perforator for fleet automation.
AI-written summary · about
chapters (3)
related talks
34mThe basics of Profile-Guided Optimization (PGO) in Rust
06mProfile-Guided Optimization in the Go Compiler
29mEmpirical Observations about Profile-Guided Optimizations for Mainstream C/C++ Compilers
22mProfile Inference Revisited
23m"The Current State and Future of Rust Compiler Performance"
24mRust performance debugging with TUIs and LLMs
16mPlace Capability Graphs: A General-Purpose Model of Rust’s Ownership and Borrowing(…)
27mImproving Rust Performance Through Profiling and Benchmarking
