Skip to content

Commit 2105cee

Browse files
committed
Auto merge of rust-lang#122462 - erikdesjardins:forsize, r=<try>
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.
2 parents 6f3eb1c + 03e7e9e commit 2105cee

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Cargo.toml

+8-5
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,15 @@ overflow-checks = false
9999
# (more data to chew through) and binaries to be larger without really all that
100100
# much benefit. This section turns them all to down to have no debuginfo which
101101
# helps to improve link times a little bit.
102+
# For the same reason, we also use opt-level=s to save binary size, at a small
103+
# performance cost.
102104
[profile.release.package]
103-
addr2line.debug = 0
104-
adler.debug = 0
105-
gimli.debug = 0
106-
miniz_oxide.debug = 0
107-
object.debug = 0
105+
addr2line = { debug = 0, opt-level = 's' }
106+
adler = { debug = 0, opt-level = 's' }
107+
gimli = { debug = 0, opt-level = 's' }
108+
miniz_oxide = { debug = 0, opt-level = 's' }
109+
object = { debug = 0, opt-level = 's' }
110+
rustc-demangle = { debug = 0, opt-level = 's' }
108111

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

0 commit comments

Comments
 (0)