Skip to content

Commit

Permalink
Auto merge of #122462 - erikdesjardins:forsize, r=<try>
Browse files Browse the repository at this point in the history
Compile backtrace-related deps with `opt-level=s`

Locally, this shrinks a stripped helloworld by 8k (~2%), which isn't huge but it's something.

I also tried `opt-level=z` but it produces the same result. `opt-level=s` is preferrable in that case since it inhibits fewer optimizations.
  • Loading branch information
bors committed Mar 14, 2024
2 parents 6f3eb1c + 03e7e9e commit 2105cee
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,15 @@ overflow-checks = false
# (more data to chew through) and binaries to be larger without really all that
# much benefit. This section turns them all to down to have no debuginfo which
# helps to improve link times a little bit.
# For the same reason, we also use opt-level=s to save binary size, at a small
# performance cost.
[profile.release.package]
addr2line.debug = 0
adler.debug = 0
gimli.debug = 0
miniz_oxide.debug = 0
object.debug = 0
addr2line = { debug = 0, opt-level = 's' }
adler = { debug = 0, opt-level = 's' }
gimli = { debug = 0, opt-level = 's' }
miniz_oxide = { debug = 0, opt-level = 's' }
object = { debug = 0, opt-level = 's' }
rustc-demangle = { debug = 0, opt-level = 's' }

# These are very thin wrappers around executing lld with the right binary name.
# Basically nothing within them can go wrong without having been explicitly logged anyway.
Expand Down

0 comments on commit 2105cee

Please sign in to comment.