#!/usr/bin/env bash # Run-queue shootout driver (ROADMAP_v0.5 phase 4). # # Rebuilds the runtime bench once per rq-* feature and runs the raw-structure # microbench once (it covers all structures in a single binary). Results land # in bench_results/ as full logs; the RQCSV lines are aggregated into # bench_results/summary.csv for plotting. # # Tune the sweep for the box, e.g. on the 20-core machine: # SMARM_BENCH_THREADS="1 2 4 8 16 20" ./scripts/bench_rq.sh set -euo pipefail cd "$(dirname "$0")/.." OUT=bench_results mkdir -p "$OUT" : "${SMARM_BENCH_THREADS:=1 2 4}" export SMARM_BENCH_THREADS echo "== raw structures (one binary, all variants) ==" cargo bench --bench rq_micro 2>&1 | tee "$OUT/micro.txt" for v in rq-mutex rq-mpmc rq-striped; do echo "== runtime benches: $v ==" cargo bench --bench rq_runtime --no-default-features --features "$v" \ 2>&1 | tee "$OUT/runtime-$v.txt" done echo "bench,kind,a,b,c,d,median_us,ops_per_s" > "$OUT/summary.csv" grep -h '^RQCSV,' "$OUT"/*.txt | sed 's/^RQCSV,//' >> "$OUT/summary.csv" echo echo "Summary: $OUT/summary.csv ($(($(wc -l < "$OUT/summary.csv") - 1)) rows)"