From bf8102a8d6fe766c639126cd140bf38466741dd4 Mon Sep 17 00:00:00 2001 From: Illia Polosukhin Date: Tue, 10 Mar 2026 18:06:36 +0000 Subject: [PATCH] perf: optimize release and dist build profiles (#843) * perf: optimize release and dist build profiles Add [profile.release] with strip=true and panic="abort" for smaller, faster release binaries. Upgrade [profile.dist] from lto="thin" to lto="fat" with codegen-units=1 for maximum optimization in CI releases. Co-Authored-By: Claude Opus 4.6 * fix: remove panic=abort from release profile Reviewers (zmanian, Copilot, Gemini) correctly flagged that panic=abort in the release profile would kill the entire process on any tokio task panic, breaking fault isolation for the long-running server. Removed from release profile entirely. Co-Authored-By: Claude Opus 4.6 --------- Co-authored-by: Claude Opus 4.6 --- Cargo.toml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 1e1d909a..61293a20 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -214,10 +214,14 @@ bedrock = ["dep:aws-config", "dep:aws-sdk-bedrockruntime", "dep:aws-smithy-types name = "html_to_markdown" required-features = ["html-to-markdown"] +[profile.release] +strip = true # Remove debug symbols from release binaries + # The profile that 'cargo dist' will build with [profile.dist] inherits = "release" -lto = "thin" +lto = "fat" # Full cross-crate LTO (slow build, better codegen) +codegen-units = 1 # Single codegen unit for maximum optimization # Config for 'dist' [workspace.metadata.dist]