#!/usr/bin/env bash # Inner-loop evaluation scaling curve: runs `inner_loop` at thread counts 1, 2, 4, 8, 16 # and prints one JSON line per thread count. Fixtures are the committed dumps under # `bench/fixtures/` (regenerate with `cargo run --release --bin gen_fixtures`). # # Usage: bench/run-inner-loop.sh [seconds-per-run] set -euo pipefail BENCH_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" export CARGO_TARGET_DIR="$BENCH_DIR/target" BIN="$CARGO_TARGET_DIR/release/inner_loop" SECONDS_PER_RUN="${1:-2}" cargo build --release --manifest-path "$BENCH_DIR/Cargo.toml" --bin inner_loop >/dev/null for t in 1 2 4 8 16; do echo "load before threads=$t: $(uptime)" >&2 "$BIN" --threads "$t" --seconds "$SECONDS_PER_RUN" | tail -n1 done