diff --git a/Cargo.toml b/Cargo.toml index 777723e3..3c5e5c46 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -205,6 +205,18 @@ lto = "fat" codegen-units = 1 strip = "debuginfo" +# Iteration-speed sibling of `release`: thin LTO parallelizes the LTO +# stage across cores instead of fat LTO's single-threaded whole-graph +# pass — measured cold builds of the aisix binary on a 12-core host: +# 6m37s (release) vs 2m27s (release-dev). Functionally identical output, +# slightly less optimized — so any number that gets reported, compared +# against a baseline, or fed into the saturation grid MUST come from +# `--release`, never from this profile. +[profile.release-dev] +inherits = "release" +lto = "thin" +codegen-units = 16 + [profile.coverage] inherits = "dev" opt-level = 0 diff --git a/bench/onthebench/run-baseline.sh b/bench/onthebench/run-baseline.sh index 53283789..8b136aef 100755 --- a/bench/onthebench/run-baseline.sh +++ b/bench/onthebench/run-baseline.sh @@ -27,7 +27,12 @@ BIN="$SRC/target/release/aisix" # ---- sanity ----------------------------------------------------------------- -[ -x "$BIN" ] || { echo "FATAL: $BIN missing - build first"; exit 1; } +# Rebuild instead of trusting mtime: with iteration builds living in +# target/release-dev, a stale target/release binary is silent poison — +# meta.json would attribute the numbers to the wrong commit. A no-op +# when the binary is already current. +( cd "$SRC" && cargo build --locked --release --bin aisix ) +[ -x "$BIN" ] || { echo "FATAL: $BIN missing after build"; exit 1; } rig_sanity if [ "$FLAMEGRAPH" = 1 ]; then require_symbols "$BIN"; fi diff --git a/bench/onthebench/run-decay.sh b/bench/onthebench/run-decay.sh index 60244f39..b4b8c776 100755 --- a/bench/onthebench/run-decay.sh +++ b/bench/onthebench/run-decay.sh @@ -56,7 +56,10 @@ BIN="$SRC/target/release/aisix" # ---- sanity ----------------------------------------------------------------- -[ -x "$BIN" ] || { echo "FATAL: $BIN missing - build first"; exit 1; } +# Rebuild instead of trusting mtime — same stale-binary gate as +# run-baseline.sh; a no-op when the binary is already current. +( cd "$SRC" && cargo build --locked --release --bin aisix ) +[ -x "$BIN" ] || { echo "FATAL: $BIN missing after build"; exit 1; } rig_sanity bench_init