From 9fe16430897fca8705417f53a27a2fa9ddc4eeaf Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Thu, 11 Aug 2022 11:35:26 +0000 Subject: [PATCH] build: enable size optimization for release profile This reduces the binary size from 7.3M to 6.5M. Also the build time for a clean build shrinks from 1m28s to 1m14s on my development machine (an eight-core VM on Azure). This goes against the conventional wisdom but it is what it is. Signed-off-by: Wei Liu --- Cargo.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 859ae07af..a930a8cb5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,8 @@ rust-version = "1.60" [profile.release] lto = true +codegen-units = 1 +opt-level = "s" [dependencies] anyhow = "1.0.65"