Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit d3c2955

Browse files
authored
Unrolled build for rust-lang#114998
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 54e57e6 + 515535a commit d3c2955

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

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

Lines changed: 23 additions & 0 deletions
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)