From 4e113ce511193b65e6ebf81cb0a659f7e7f6566b Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Wed, 1 Nov 2023 10:21:38 +0100 Subject: [PATCH 1/2] chore: reduce realease binary size --- Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 68ed130549..21e8929a13 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -114,3 +114,6 @@ winapi = "0.3.9" [profile.release] opt-level = 3 panic = "abort" +strip = true # Strip symbols from the binary. +codegen-units = 1 # Parallel compilation prevents some optimizations. +lto = true # Enable Link-time optimizations to remove dead code. From de472a2328f157f598e0b26726c80141707fa1e0 Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Thu, 2 Nov 2023 11:22:35 +0100 Subject: [PATCH 2/2] opt-level z --- Cargo.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 21e8929a13..0fc1be9490 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -111,8 +111,9 @@ crossbeam-channel = "0.5.6" [target."cfg(windows)".dependencies] winapi = "0.3.9" +# We optimize the release build for size. [profile.release] -opt-level = 3 +opt-level = "z" panic = "abort" strip = true # Strip symbols from the binary. codegen-units = 1 # Parallel compilation prevents some optimizations.