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 2003d6dba10..cdca99ffae8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -41,6 +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 ` +* 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