Skip to content

Commit 17b979a

Browse files
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.
1 parent 3cbb932 commit 17b979a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Cargo.toml

+10
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,16 @@ adler.debug = 0
105105
gimli.debug = 0
106106
miniz_oxide.debug = 0
107107
object.debug = 0
108+
rustc-demangle.debug = 0
109+
# Similar to above, as these libraries are used for backtrace symbolication,
110+
# we can afford to sacrifice a small amount of performance in order to get
111+
# smaller binaries by optimizing for size.
112+
addr2line.opt-level = 's'
113+
adler.opt-level = 's'
114+
gimli.opt-level = 's'
115+
miniz_oxide.opt-level = 's'
116+
object.opt-level = 's'
117+
rustc-demangle.opt-level = 's'
108118

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

0 commit comments

Comments
 (0)