Skip to content
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

Optimize release profile #38

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

simonmarty
Copy link
Contributor

@simonmarty simonmarty commented Nov 18, 2024

Issue #, if available: See #9

https://doc.rust-lang.org/cargo/reference/profiles.html

Description of changes:

Experimenting with release profile parameters

  • lto = "thin to use link time optimization across the dependency tree. This increases the binary size by 0.5MB on stable-x86_64-apple-darwin. At the moment I'm not seeing a significant performance disparity between this being set to "thin" or "off". This might differ between platforms.
  • codegen-units = 1, significantly increases compilation time, is supposed to help with optimization, does appear to reduce binary size by a little over 1MB.
  • strip = true Removes symbols and debug info, reduces binary size (13MB -> 9MB).

Before merging:

Run a load test and verify this leads to a consistent performance improvement on

  • stable-x86_64-unknown-linux-gnu
  • stable-x86_64-unknown-linux-musl
  • stable-aarch64-unknown-linux-gnu
  • stable-aarch64-unknown-linux-musl
  • stable-x86_64-pc-windows-msvc

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant