Skip to content

Commit

Permalink
limit codegen-units to get the maximum optimization (#2138)
Browse files Browse the repository at this point in the history
* Update Cargo.toml

* Update Cargo.toml

* Update Cargo.toml

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>

* Update Cargo.toml

Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Mar 14, 2022
1 parent 88f81ff commit c4d9437
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,14 @@ opt-level = 3
[profile.release]
panic = "abort"
lto = true
# codegen-units set to 1 to avoid performance regressions when combined with LTO
# See https://github.com/rust-lang/rust/issues/47745
# https://doc.rust-lang.org/rustc/codegen-options/index.html#codegen-units
codegen-units = 1
#strip = "symbols" # TODO: uncomment once stable

[profile.min-size-release]
inherits = "release"
lto = true
opt-level = "z"

[[bench]]
Expand Down

0 comments on commit c4d9437

Please sign in to comment.