aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2018-10-12 12:16:20 +0200
committerTeddy Wing2018-10-12 12:16:20 +0200
commitd57787a8f45e173a19106c7d3d0140d0ac6a7d46 (patch)
treeab18d8027646cfae9347ed68385eb87be82b3074
parentf21fce30bf46105ab805b596de60568f108a59d3 (diff)
downloaddome-key-map-d57787a8f45e173a19106c7d3d0140d0ac6a7d46.tar.bz2
Cargo.toml: Turn on link-time optimisation
Thanks to Lifthrasiir for the detailed information about reducing Rust compiled binary size: https://lifthrasiir.github.io/rustlog/why-is-a-rust-executable-large.html Using link-time optimisation gets our release build built with cargo build --release down from 13 Mb to 2 Mb. Pretty good. Using RUSTFLAGS="-C opt-level=s" cargo build --release # or RUSTFLAGS="-C opt-level=z" cargo build --release brought it down additionally to 1.9 Mb. Still trying to decide if I want to keep that. Think I might, but will add it later.
-rw-r--r--Cargo.toml3
1 files changed, 3 insertions, 0 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 905af39..8b82c16 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -18,3 +18,6 @@ cbindgen = "0.6.2"
[lib]
crate-type = ["staticlib"]
+
+[profile.release]
+lto = true