From b6bac8484e5466d332640c4022951061bb865329 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Mon, 27 Nov 2023 21:31:03 -0500 Subject: [PATCH] cargo: add release-lto profile The idea is to build ripgrep with as much optimization as possible. This makes compilation times absolutely obscene. They jump from <10 seconds to 30+ seconds on my i9-12900K. I don't even want to know how long CI would take with these. I tried some ad hoc benchmarks and could not notice any meaningful improvement with the LTO binary versus the normal release profile. Because of that, I still don't think it's worth bloating the release cycle times. Ref #1225 --- Cargo.toml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index d95858e..19cbb27 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -74,6 +74,18 @@ pcre2 = ["grep/pcre2"] [profile.release] debug = 1 +[profile.release-lto] +inherits = "release" +opt-level = 3 +debug = "none" +strip = "symbols" +debug-assertions = false +overflow-checks = false +lto = "fat" +panic = "abort" +incremental = false +codegen-units = 1 + # This is the main way to strip binaries in the deb package created by # 'cargo deb'. For other release binaries, we (currently) call 'strip' # explicitly in the release process.