diff options
| author | Teddy Wing | 2018-10-12 12:16:20 +0200 |
|---|---|---|
| committer | Teddy Wing | 2018-10-12 12:16:20 +0200 |
| commit | d57787a8f45e173a19106c7d3d0140d0ac6a7d46 (patch) | |
| tree | ab18d8027646cfae9347ed68385eb87be82b3074 | |
| parent | f21fce30bf46105ab805b596de60568f108a59d3 (diff) | |
| download | dome-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.toml | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -18,3 +18,6 @@ cbindgen = "0.6.2" [lib] crate-type = ["staticlib"] + +[profile.release] +lto = true |
