This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -145,3 +145,25 @@ in Clang's documentation is therefore an interesting read for anyone who wants
145145to use PGO with Rust.
146146
147147[ clang-pgo ] : https://clang.llvm.org/docs/UsersManual.html#profile-guided-optimization
148+
149+ ## Community Maintained Tools
150+
151+ As an alternative to directly using the compiler for Profile-Guided Optimization,
152+ you may choose to go with ` cargo-pgo ` , which has an intuitive command-line API
153+ and saves you the trouble of doing all the manual work. You can read more about
154+ it in their repository accessible from this link: https://github.com/Kobzol/cargo-pgo
155+
156+ For the sake of completeness, here are the corresponding steps using ` cargo-pgo ` :
157+
158+ ``` bash
159+ # Install the binary as usual: cargo install cargo-pgo
160+ cargo pgo build
161+ LLVM_PROFILE_FILE=./target/pgo-profiles/rustc-pgo_%m_%p.profraw ./target/x86_64-unknown-linux-gnu/release/myprogram
162+ cargo pgo optimize
163+ ```
164+
165+ These steps will do the following just as before:
166+
167+ 1 . Build an instrumented binary from the source code.
168+ 2 . Use the instrumentation in the binary when running it for the first time.
169+ 3 . Use the instrumentation results from the last step to create an optimized binary.
You can’t perform that action at this time.
0 commit comments