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

[LTO] Set codegen units to 1 #5085

Open
ksolana opened this issue Feb 27, 2025 · 0 comments · May be fixed by #5087
Open

[LTO] Set codegen units to 1 #5085

ksolana opened this issue Feb 27, 2025 · 0 comments · May be fixed by #5087

Comments

@ksolana
Copy link

ksolana commented Feb 27, 2025

Problem

@LucasSte suggested we should experiment thinlto builds by setting codegen units to 1
As per Source: https://nnethercote.github.io/perf-book/build-configuration.html#codegen-units

he Rust compiler splits crates into multiple [codegen units](https://doc.rust-lang.org/cargo/reference/profiles.html#codegen-units) to parallelize (and thus speed up) compilation. However, this might cause it to miss some potential optimizations. You may be able to improve runtime speed and reduce binary size, at the cost of increased compile times, by setting the number of units to one. Add these lines to the Cargo.toml file:

Proposed Solution

Add codegen-units = 1 to the build setting.

@ksolana ksolana linked a pull request Feb 27, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant