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:
56
benchmarks/scripts/comprehensive/run_perf_hot_triad.sh
Normal file
56
benchmarks/scripts/comprehensive/run_perf_hot_triad.sh
Normal file
@ -0,0 +1,56 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# perf-stat triad (HAKMEM/System/mimalloc) for bench_tiny_hot at a single size/batch/cycles
|
||||
# Collects cycles/instructions/branches/branch-misses/L1-dcache-load-misses (CSV via perf -x ,)
|
||||
# Usage: scripts/run_perf_hot_triad.sh [size] [batch] [cycles] [reps]
|
||||
# size : bytes (default 32)
|
||||
# batch : batch size (default 100)
|
||||
# cycles: loop cycles per op (default 50000)
|
||||
# reps : perf repetitions (default 3)
|
||||
|
||||
ROOT_DIR=$(cd "$(dirname "$0")/.." && pwd)
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
size=${1:-32}
|
||||
batch=${2:-100}
|
||||
cycles=${3:-50000}
|
||||
reps=${4:-3}
|
||||
|
||||
echo "[build] benches (fast + mi)"
|
||||
make -s bench_fast bench_tiny_hot_mi >/dev/null
|
||||
|
||||
# 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/perf_hot_triad_${TS}"
|
||||
mkdir -p "$OUTDIR"
|
||||
|
||||
echo "[info] size=$size batch=$batch cycles=$cycles reps=$reps"
|
||||
echo "[info] results → $OUTDIR"
|
||||
|
||||
run_perf() {
|
||||
local alloc="$1"; shift
|
||||
local bin="$1"; shift
|
||||
local tag="$alloc"_s${size}_b${batch}_c${cycles}
|
||||
local log="$OUTDIR/${tag}.perf.csv"
|
||||
echo "[perf] $tag"
|
||||
if [[ "$alloc" == "mimalloc" ]]; then
|
||||
LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$MI_LIBDIR" \
|
||||
perf stat -x , -r "$reps" -e cycles,instructions,branches,branch-misses,L1-dcache-load-misses \
|
||||
"$bin" "$size" "$batch" "$cycles" 1>/dev/null 2>"$log" || true
|
||||
else
|
||||
perf stat -x , -r "$reps" -e cycles,instructions,branches,branch-misses,L1-dcache-load-misses \
|
||||
"$bin" "$size" "$batch" "$cycles" 1>/dev/null 2>"$log" || true
|
||||
fi
|
||||
}
|
||||
|
||||
run_perf hakmem ./bench_tiny_hot_hakmem
|
||||
run_perf system ./bench_tiny_hot_system
|
||||
run_perf mimalloc ./bench_tiny_hot_mi
|
||||
|
||||
echo "[done] perf CSVs under: $OUTDIR"
|
||||
ls -1 "$OUTDIR" | sed -n '1,20p'
|
||||
|
||||
Reference in New Issue
Block a user