From 060841d0110b5de957d3469faca07dd0d47c328d Mon Sep 17 00:00:00 2001 From: Stephen Waits Date: Tue, 5 May 2026 12:03:52 -0600 Subject: [PATCH] build(release): enable thin LTO + codegen-units=1 in release profile Cuts ~150 ms (-2.5 %) off the compare harness via better cross-crate inlining of small Pareto/HV helpers. Costs ~20 s extra on a from- scratch `cargo build --release`, but is essentially free on incremental rebuilds. Only applies when this crate is the workspace root (i.e. when developing heuropt or running its own examples). Downstream users who consume heuropt as a dependency see whatever profile their own Cargo.toml configures. --- Cargo.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 053a85e..55bda82 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,3 +31,10 @@ proptest = "1" [[bench]] name = "hot_paths" harness = false + +# Tighten release codegen for the compare harness and downstream binaries +# that build heuropt directly (i.e. when this crate is the workspace root). +# When heuropt is used as a dependency the consumer's profile wins. +[profile.release] +lto = "thin" +codegen-units = 1