From 7ad0f96222158788b8a262f9c77bbab9dd45b6b4 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Sun, 15 Feb 2026 08:58:57 +0000 Subject: [PATCH] release builds: set lto="thin" and strip="debuginfo" (#1342) - thin LTO is much much faster to compile, this will help when making release builds - strip="debuginfo" allows to still have symbols when unwinding stack traces, which are usefull to have in user's bug reports. Binary size is increased from 23M to 27M, so a reasonable increase Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/1342 Co-authored-by: Alex Auvolat Co-committed-by: Alex Auvolat --- Cargo.toml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 933f731f..be2e95a8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -174,12 +174,8 @@ aws-sdk-s3 = { version = "1.121", default-features = false, features = [ "rt-tokio", ] } -[profile.dev] -#lto = "thin" # disabled for now, adds 2-4 min to each CI build -lto = "off" - [profile.release] -lto = true -codegen-units = 1 +lto = "thin" +codegen-units = 16 opt-level = 3 -strip = true +strip = "debuginfo"