From 38cb683720878116e9d40264b95e145f9bf956c4 Mon Sep 17 00:00:00 2001 From: Nic-dorman Date: Tue, 9 Jun 2026 15:33:17 +0100 Subject: [PATCH] build(antd): size-optimized release profile (strip + thin LTO) Adds [profile.release] with strip = symbols, lto = thin, codegen-units = 1. Measured 2026-06-09 against the default release profile: Linux 36.5 MB -> 22.1 MB (-37%), Windows .exe 29.8 MB -> 24.6 MB (-17%). strip is the dominant, zero-cost win on Linux; thin LTO + single codegen unit add the rest. Cost is a slower release link only (dev builds unaffected). Both optimized binaries smoke-tested on Linux + Windows: launch, --help, and serve a valid /health response. Co-Authored-By: Claude Opus 4.8 (1M context) --- antd/Cargo.toml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/antd/Cargo.toml b/antd/Cargo.toml index f0486514..7024b612 100644 --- a/antd/Cargo.toml +++ b/antd/Cargo.toml @@ -32,3 +32,15 @@ toml = "0.8" [build-dependencies] tonic-build = "0.12" + +# Release profile tuned for binary size. Measured on antd (2026-06-09): +# Linux 36.5 MB -> 22.1 MB (-37%), Windows .exe 29.8 MB -> 24.6 MB (-17%). +# `strip` alone is the big, free win on Linux (debug symbols the .exe never +# needed); thin LTO + a single codegen unit add the rest and tend to improve +# runtime perf, at the cost of a slower release link (does not affect dev / +# `cargo build`). Both variants smoke-tested (launch + /health) on Linux and +# Windows. +[profile.release] +strip = "symbols" +lto = "thin" +codegen-units = 1