From 1db7ab935fcc6d071a2a8901438b8f9e96b67058 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Mon, 2 Dec 2024 10:22:21 +0100 Subject: [PATCH] Further shrink the WASM output by using more aggressive optimizations --- Cargo.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index a5a87bd3e..442d3fe9e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,6 +45,10 @@ wasm-opt = ['-Oz', '-g'] # Tell cargo to run `rustc` with `-Oz` - ie, to optimize for size. # https://doc.rust-lang.org/cargo/reference/profiles.html#opt-level opt-level = 'z' +# Use a single codegen-unit to enable better optimizations +codegen-units = 1 +# Enable fat link time optimization +lto = true [lib] crate-type = ["cdylib"]