2025-11-07 01:27:04 +09:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
# run_larson_dev.sh — deterministic run wrapper (avoids perf warm-up issues)
|
|
|
|
|
#
|
|
|
|
|
# Usage:
|
|
|
|
|
# scripts/run_larson_dev.sh tput 10 4
|
|
|
|
|
# scripts/run_larson_dev.sh pf 10 4
|
|
|
|
|
#
|
|
|
|
|
# Notes:
|
|
|
|
|
# - Runs ./larson_hakmem directly and prints the Throughput line.
|
|
|
|
|
# - Keeps logging quiet and avoids perf warm-ups that sometimes SEGV under A/B.
|
|
|
|
|
|
|
|
|
|
MODE=${1:-tput}
|
|
|
|
|
DUR=${2:-10}
|
|
|
|
|
THR=${3:-4}
|
|
|
|
|
|
|
|
|
|
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. && pwd)"
|
|
|
|
|
cd "$ROOT_DIR"
|
|
|
|
|
|
|
|
|
|
[[ -x ./larson_hakmem ]] || ./scripts/build_larson_dev.sh
|
|
|
|
|
|
|
|
|
|
export HAKMEM_QUIET=1
|
|
|
|
|
export HAKMEM_TINY_SUKESUKE=0
|
|
|
|
|
export HAKMEM_TINY_TRACE_RING=0
|
|
|
|
|
export HAKMEM_DISABLE_BATCH=1
|
|
|
|
|
export HAKMEM_WRAP_TINY=1
|
|
|
|
|
export HAKMEM_LARSON_TINY_ONLY=1
|
|
|
|
|
export HAKMEM_TINY_META_ALLOC=1
|
|
|
|
|
export HAKMEM_TINY_META_FREE=1
|
|
|
|
|
export HAKMEM_TINY_USE_SUPERSLAB=1
|
|
|
|
|
|
|
|
|
|
if [[ "$MODE" == "tput" ]]; then
|
|
|
|
|
export HAKMEM_TINY_FREE_TO_SS=0
|
|
|
|
|
export HAKMEM_TINY_MUST_ADOPT=0
|
|
|
|
|
export HAKMEM_TINY_REG_SCAN_MAX=${HAKMEM_TINY_REG_SCAN_MAX:-64}
|
|
|
|
|
export HAKMEM_SFC_ENABLE=${HAKMEM_SFC_ENABLE:-1}
|
|
|
|
|
export HAKMEM_TINY_TLS_LIST=${HAKMEM_TINY_TLS_LIST:-1}
|
|
|
|
|
export HAKMEM_TINY_TLS_SLL=${HAKMEM_TINY_TLS_SLL:-1}
|
|
|
|
|
else
|
|
|
|
|
export HAKMEM_TINY_FREE_TO_SS=1
|
|
|
|
|
export HAKMEM_TINY_MUST_ADOPT=1
|
|
|
|
|
export HAKMEM_TINY_SS_ADOPT_COOLDOWN=${HAKMEM_TINY_SS_ADOPT_COOLDOWN:-64}
|
|
|
|
|
export HAKMEM_TINY_REG_SCAN_MAX=${HAKMEM_TINY_REG_SCAN_MAX:-32}
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo "[run_dev] mode=$MODE dur=$DUR thr=$THR"
|
2025-11-07 18:07:48 +09:00
|
|
|
./larson_hakmem "$DUR" 8 128 1024 1 12345 "$THR" | grep -n "Throughput" || true
|
2025-11-07 01:27:04 +09:00
|
|
|
|