From 3f3b3b3aa0452f482ed8090149a5dae5e113f463 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Mon, 15 Apr 2024 07:58:36 -0400 Subject: [PATCH] Shrink backtrace generation in std --- Cargo.toml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index bbf4ecfe61d07..1068e77179905 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -90,6 +90,10 @@ 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. +# +# We also trim down the binary size of generated code by telling LLVM to +# optimize for size. This code should not be particularly hot, so there's not +# much advantage in making it fast (vs. making it small). [profile.release.package] addr2line.debug = 0 adler.debug = 0 @@ -97,6 +101,12 @@ gimli.debug = 0 miniz_oxide.debug = 0 object.debug = 0 rustc-demangle.debug = 0 +addr2line.opt-level = "z" +adler.opt-level = "z" +gimli.opt-level = "z" +miniz_oxide.opt-level = "z" +object.opt-level = "z" +rustc-demangle.opt-level = "z" # 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.