PGO on cargo release profile? #22
-
Hi, I ran cargo-pgo on a relatively simple actix application and saw some good performance improvements. However, the pgo optimization is a lot better than the cargo dev profile, but not quite as good as the release profile with LTO & strip. I use the following release config: [profile.release]
codegen-units = 1 # default is 16
lto = true # default is false
strip = true # reduces binary size
panic = "abort" Adding release to the build command resulted in an error. cargo pgo instrument build release The question I have is, how do I use PGO on the release profile? Marvin |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Hi, |
Beta Was this translation helpful? Give feedback.
-
Thank you for the clarification.
Will measure again tomorrow.
Would you please add this to the documentation?
…On Fri, Oct 21, 2022 at 4:29 PM Jakub Beránek ***@***.***> wrote:
Hi, cargo pgo internally adds --release to all builds commands, so
everything should be built in release mode. It should also respect the
[profile.release] configuration from your Cargo.toml file.
—
Reply to this email directly, view it on GitHub
<#22 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A3RLRXLVPQR7CJOUAO3A4G3WEJH6NANCNFSM6AAAAAARK5NULM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
It's written in the README (https://github.com/Kobzol/cargo-pgo#pgo). Is there another place where you would like to see this information?
$ cargo pgo build -- --release
$ [WARN] Do not pass `--release` manually, it will be added automatically by `cargo-pgo` |
Beta Was this translation helpful? Give feedback.
-
Yes, you're right of course. |
Beta Was this translation helpful? Give feedback.
It's written in the README (https://github.com/Kobzol/cargo-pgo#pgo). Is there another place where you would like to see this information?
cargo-pgo
also warns about this, but you have to execute the command with the proper flag (--release
vsrelease
):