From 2043d1d6c145f22163e445bca1dc928900001ef7 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Tue, 28 Jul 2026 09:56:19 +0200 Subject: [PATCH 1/2] Switch the release profile to thin LTO and default codegen-units Experiment to measure the build time and binary size difference against fat LTO with codegen-units=1, which spends ~10 serial minutes on the final LTO+codegen pass of mas-cli in CI. --- Cargo.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9b5aca476..b4b1f7712 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -744,8 +744,10 @@ version = "1.8.2" version = "3.1.0" [profile.release] -codegen-units = 1 # Reduce the number of codegen units to increase optimizations -lto = true # Enable fat LTO +# This is not the most performant build we could possibly do, but other +# optimisations like `codegen-units = 1` and fat LTO are quite expensive on +# compilation time, with relatively modest advantages over just thin LTO +lto = "thin" # A few profile opt-level tweaks to make the test suite run faster [profile.dev.package] From 2805a6784fc658c4bc5de944bb8a9d70b3531e65 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Tue, 28 Jul 2026 18:26:26 +0200 Subject: [PATCH 2/2] Expand the comment on why we're fine with thin LTO Co-Authored-By: Eric Eastwood --- Cargo.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index b4b1f7712..d9e1dfbc8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -746,7 +746,9 @@ version = "3.1.0" [profile.release] # This is not the most performant build we could possibly do, but other # optimisations like `codegen-units = 1` and fat LTO are quite expensive on -# compilation time, with relatively modest advantages over just thin LTO +# compilation time, with relatively modest perf advantages over just thin LTO +# (we saw 3-5% perf difference) and we'd rather optimize for compilation time +# at the moment. lto = "thin" # A few profile opt-level tweaks to make the test suite run faster