Skip to content

Commit

Permalink
build: Change release opt-level
Browse files Browse the repository at this point in the history
On my system, I obtained the smallest binary size with `opt-level = 2` (11.8 MB, versus 12.2 MB with `opt-level = "z"`).
  • Loading branch information
szokeasaurusrex committed Dec 20, 2024
1 parent ed19a2b commit c08be9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ winapi = "0.3.9"

# We optimize the release build for size.
[profile.release]
opt-level = "z"
opt-level = 2 # I obtained the smallest binary size with opt-level 2 on my system.
panic = "abort"
strip = "debuginfo" # Only strip debuginfo (not symbols) to keep backtraces useful.
codegen-units = 1 # Parallel compilation prevents some optimizations.
Expand Down

0 comments on commit c08be9a

Please sign in to comment.