Skip to content

Commit b35db0d

Browse files
authored
feat: simple release binary size optimization
This change for the release build enables: - Link Time Optimization (LTO) which drops some of the dead code - Forces Rust to use 1 codegen unit for maximum code optimization regarding size and speed - Removes stack unwinding. Meaning there is no stack trace on panic. These settings reduced the size of release build from 4.3M to 2.9M on my machine.
1 parent 5f07ada commit b35db0d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Cargo.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,10 @@ rayon = "1.10.0"
2525
[dev-dependencies]
2626
assert_cmd = "2.0"
2727
predicates = "3.1"
28-
tempfile = "3.10"
28+
tempfile = "3.10"
29+
30+
[profile.release]
31+
strip = true
32+
lto = true
33+
codegen-units = 1
34+
panic = "abort"

0 commit comments

Comments
 (0)