Files
hakmem/archive/experimental_scripts/ab_l25_tc.sh

35 lines
1.1 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
set -euo pipefail
# A/B for L2.5 TC spill and run factor (10s, Large 4T)
ROOT_DIR=$(cd "$(dirname "$0")/.." && pwd)
LARSON="$ROOT_DIR/mimalloc-bench/bench/larson/larson"
LIB_HAK="$ROOT_DIR/libhakmem.so"
RUNTIME=${RUNTIME:-10}
THREADS=${THREADS:-4}
FACTORS=${FACTORS:-"3 4 5"}
SPILLS=${SPILLS:-"16 32 64"}
TS=$(date +%Y%m%d_%H%M%S)
OUT="$ROOT_DIR/docs/benchmarks/${TS}_L25_TC_AB"
mkdir -p "$OUT"
echo "[OUT] $OUT"
cd "$ROOT_DIR/mimalloc-bench/bench/larson"
for f in $FACTORS; do
for s in $SPILLS; do
name="F${f}_S${s}"
echo "=== $name ===" | tee "$OUT/${name}.log"
timeout "${BENCH_TIMEOUT:-$((RUNTIME+3))}s" env LD_PRELOAD="$LIB_HAK" HAKMEM_WRAP_L25=1 HAKMEM_L25_PREF=remote HAKMEM_L25_RUN_FACTOR=$f \
HAKMEM_HDR_LIGHT=2 HAKMEM_L25_TC_SPILL=$s HAKMEM_SHARD_MIX=1 HAKMEM_TLS_LO_MAX=512 \
"$LARSON" "$RUNTIME" 65536 1048576 10000 1 12345 "$THREADS" 2>&1 | tee -a "$OUT/${name}.log"
done
done
cd - >/dev/null
rg -n "Throughput" "$OUT"/*.log | sort -k2,2 -k1,1 | tee "$OUT/summary.txt" || true
echo "[DONE] Logs at $OUT"