Skip to content

Commit f3c94a5

Browse files
authored
Rollup merge of rust-lang#114998 - meysam81:meysam/feat/add-cargo-pgo-to-docs, r=ehuss
feat(docs): add cargo-pgo to PGO documentation 📝 fixes rust-lang#114995
2 parents 31ffe48 + 515535a commit f3c94a5

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/doc/rustc/src/profile-guided-optimization.md

+23
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,26 @@ in Clang's documentation is therefore an interesting read for anyone who wants
145145
to 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 if you haven't already
160+
cargo install cargo-pgo
161+
162+
cargo pgo build
163+
cargo pgo optimize
164+
```
165+
166+
These steps will do the following just as before:
167+
168+
1. Build an instrumented binary from the source code.
169+
2. Run the instrumented binary to gather PGO profiles.
170+
3. Use the gathered PGO profiles from the last step to build an optimized binary.

0 commit comments

Comments
 (0)