Debug Counters Implementation - Clean History
Major Features: - Debug counter infrastructure for Refill Stage tracking - Free Pipeline counters (ss_local, ss_remote, tls_sll) - Diagnostic counters for early return analysis - Unified larson.sh benchmark runner with profiles - Phase 6-3 regression analysis documentation Bug Fixes: - Fix SuperSlab disabled by default (HAKMEM_TINY_USE_SUPERSLAB) - Fix profile variable naming consistency - Add .gitignore patterns for large files Performance: - Phase 6-3: 4.79 M ops/s (has OOM risk) - With SuperSlab: 3.13 M ops/s (+19% improvement) This is a clean repository without large log files. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
61
benchmarks/scripts/tiny/run_tiny_hot_triad.sh
Normal file
61
benchmarks/scripts/tiny/run_tiny_hot_triad.sh
Normal file
@ -0,0 +1,61 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Run tiny hot bench across sizes/batches for HAKMEM, System, mimalloc (direct-link triad)
|
||||
# Usage: scripts/run_tiny_hot_triad.sh [cycles]
|
||||
|
||||
ROOT_DIR=$(cd "$(dirname "$0")/.." && pwd)
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
cycles=${1:-100000}
|
||||
|
||||
if [[ "${SKIP_BUILD:-0}" != "1" ]]; then
|
||||
echo "[build] benches (fast + mi)"
|
||||
make -s bench_fast bench_tiny_hot_mi >/dev/null
|
||||
else
|
||||
echo "[build] skipped (SKIP_BUILD=1)"
|
||||
fi
|
||||
|
||||
# Ensure LD_LIBRARY_PATH is defined (set -u safety)
|
||||
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:-}"
|
||||
MI_LIBDIR="$ROOT_DIR/mimalloc-bench/extern/mi/out/release"
|
||||
|
||||
TS=$(date +%Y%m%d_%H%M%S)
|
||||
OUTDIR="bench_results/tiny_hot_triad_${TS}"
|
||||
mkdir -p "$OUTDIR"
|
||||
CSV="$OUTDIR/results.csv"
|
||||
echo "size,batch,cycles,allocator,throughput_mops" > "$CSV"
|
||||
|
||||
sizes=(8 16 24 32 40 48 56 64 128)
|
||||
batches=(50 100 200)
|
||||
|
||||
run_case() {
|
||||
local size="$1"; shift
|
||||
local batch="$1"; shift
|
||||
local cyc="$1"; shift
|
||||
local bin="$1"; shift
|
||||
local alloc="$1"; shift
|
||||
local out
|
||||
if [[ "$alloc" == "mimalloc" ]]; then
|
||||
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$MI_LIBDIR" \
|
||||
$bin "$size" "$batch" "$cyc" | sed -n 's/^Throughput: \([0-9.][0-9.]*\) M ops.*/\1/p' >"$OUTDIR/tmp.txt" || true
|
||||
else
|
||||
$bin "$size" "$batch" "$cyc" | sed -n 's/^Throughput: \([0-9.][0-9.]*\) M ops.*/\1/p' >"$OUTDIR/tmp.txt" || true
|
||||
fi
|
||||
out=$(cat "$OUTDIR/tmp.txt" || true)
|
||||
if [[ -n "$out" ]]; then echo "$size,$batch,$cyc,$alloc,$out" >> "$CSV"; fi
|
||||
}
|
||||
|
||||
for s in "${sizes[@]}"; do
|
||||
for b in "${batches[@]}"; do
|
||||
echo "[run] HAKMEM size=$s batch=$b cycles=$cycles"
|
||||
run_case "$s" "$b" "$cycles" ./bench_tiny_hot_hakmem hakmem
|
||||
echo "[run] SYSTEM size=$s batch=$b cycles=$cycles"
|
||||
run_case "$s" "$b" "$cycles" ./bench_tiny_hot_system system
|
||||
echo "[run] MIMALLOC size=$s batch=$b cycles=$cycles"
|
||||
run_case "$s" "$b" "$cycles" ./bench_tiny_hot_mi mimalloc
|
||||
done
|
||||
done
|
||||
|
||||
echo "[done] CSV: $CSV"
|
||||
sed -n '1,40p' "$CSV" || true
|
||||
Reference in New Issue
Block a user