New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cargo: Enable LTO on release build #2141
base: main
Are you sure you want to change the base?
Conversation
I think I fixed the cleanliness issues. In terms of LTO, I used to see some issues with it functioning properly. Can you do us a favor, and list out the reasons for wanting it enabled? It would also be great to show before and after binary sizes to show the value here. |
Do you remember any details on this? I've had LTO enabled on a number of Rust-based projects on my systems for some time now and haven't noticed any issues with them. Including the VMM I use for my VM infra.
Basically just to have the linker produce optimized binaries.
Before:
After:
|
Thank you, I appreciate the follow up. Will merge, and thanks for the PR! |
[profile.release] | ||
lto = true | ||
codegen-units = 1 | ||
opt-level = "s" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want s
or 3
here? I'm a little uncomfortable with optimizing for size, when I think we in most cases want to optimize for speed, i.e. 3
. It seems like if people want to override the project default they can pretty easily?
lto = true | ||
codegen-units = 1 | ||
opt-level = "s" | ||
strip = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer this to be symbols
to be clearer which strip mode is being enabled.
No description provided.