diff options
| author | bors <bors@rust-lang.org> | 2023-10-27 10:19:35 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-10-27 10:19:35 +0000 |
| commit | 95f6a01e8f8fb121ded7d0eaa86906437cb08652 (patch) | |
| tree | c98758855add922259cd3f000fa82f5747fac7dc /src | |
| parent | 54e57e66ffb8ef4f97916d46f40ddcb464fc8be3 (diff) | |
| parent | 2fdac630b4b38c8b2669d5b6071f9b822a2d3729 (diff) | |
| download | rust-95f6a01e8f8fb121ded7d0eaa86906437cb08652.tar.gz rust-95f6a01e8f8fb121ded7d0eaa86906437cb08652.zip | |
Auto merge of #117272 - matthiaskrgr:rollup-upg122z, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #114998 (feat(docs): add cargo-pgo to PGO documentation 📝) - #116868 (Tweak suggestion span for outer attr and point at item following invalid inner attr) - #117240 (Fix documentation typo in std::iter::Iterator::collect_into) - #117241 (Stash and cancel cycle errors for auto trait leakage in opaques) - #117262 (Create a new ConstantKind variant (ZeroSized) for StableMIR) - #117266 (replace transmute by raw pointer cast) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src')
| -rw-r--r-- | src/doc/rustc/src/profile-guided-optimization.md | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/doc/rustc/src/profile-guided-optimization.md b/src/doc/rustc/src/profile-guided-optimization.md index d9cf7ce30f9..38b655b7542 100644 --- a/src/doc/rustc/src/profile-guided-optimization.md +++ b/src/doc/rustc/src/profile-guided-optimization.md @@ -145,3 +145,26 @@ in Clang's documentation is therefore an interesting read for anyone who wants to use PGO with Rust. [clang-pgo]: https://clang.llvm.org/docs/UsersManual.html#profile-guided-optimization + +## Community Maintained Tools + +As an alternative to directly using the compiler for Profile-Guided Optimization, +you may choose to go with `cargo-pgo`, which has an intuitive command-line API +and saves you the trouble of doing all the manual work. You can read more about +it in their repository accessible from this link: https://github.com/Kobzol/cargo-pgo + +For the sake of completeness, here are the corresponding steps using `cargo-pgo`: + +```bash +# Install if you haven't already +cargo install cargo-pgo + +cargo pgo build +cargo pgo optimize +``` + +These steps will do the following just as before: + +1. Build an instrumented binary from the source code. +2. Run the instrumented binary to gather PGO profiles. +3. Use the gathered PGO profiles from the last step to build an optimized binary. |
