From 3d876db7fa20e50c30a57b6875dc876115606be1 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Tue, 23 Jun 2026 01:58:02 +0800 Subject: [PATCH 1/2] docs: clarify local LTO guidance --- AGENTS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENTS.md b/AGENTS.md index 2003d6dba10..214b28fad7e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -41,6 +41,7 @@ Key technical traits: async-first (tokio), Arrow-native, versioned writes with m * Coverage: `cargo +nightly llvm-cov -q -p --branch` * Coverage HTML: `cargo +nightly llvm-cov -q -p --branch --html` * Coverage for file: `python ci/coverage.py -p -f ` +* Do not enable LTO for local development, debugging, or performance testing. Keep LTO reserved for explicitly requested release artifact validation. ### Python / Java From 20671fb4f4bf60fffe97f05685ae0aa8424f20d9 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Tue, 23 Jun 2026 18:51:20 +0800 Subject: [PATCH 2/2] build: add no-lto release profile --- .cargo/config.toml | 6 ++++++ AGENTS.md | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 1d9c9ecc9da..26a4fe335ac 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -9,6 +9,12 @@ debug = true codegen-units = 16 lto = "thin" +[profile.release-no-lto] +inherits = "release" +lto = false +# Prioritize compile time when LTO is not relevant to the measurement. +codegen-units = 16 + [profile.bench] inherits = "release" lto = "thin" diff --git a/AGENTS.md b/AGENTS.md index 214b28fad7e..cdca99ffae8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -41,7 +41,10 @@ Key technical traits: async-first (tokio), Arrow-native, versioned writes with m * Coverage: `cargo +nightly llvm-cov -q -p --branch` * Coverage HTML: `cargo +nightly llvm-cov -q -p --branch --html` * Coverage for file: `python ci/coverage.py -p -f ` -* Do not enable LTO for local development, debugging, or performance testing. Keep LTO reserved for explicitly requested release artifact validation. +* Use repository-defined Cargo profiles instead of ad hoc LTO overrides. +* Use `release` or `bench` for CPU-bound benchmarks and performance numbers intended for comparison. +* Use `release-with-debug` for optimized profiling that needs debug symbols. +* Use `release-no-lto` only for local debugging, IO-bound benchmarks, or compile-time-sensitive performance investigation where LTO would not affect the measured bottleneck. ### Python / Java