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>
53 lines
1.7 KiB
Bash
Executable File
53 lines
1.7 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# Run a representative subset of mimalloc-bench with HAKMEM via LD_PRELOAD.
|
|
# Produces logs under bench_results/.
|
|
|
|
ROOT_DIR=$(cd "$(dirname "$0")/.." && pwd)
|
|
cd "$ROOT_DIR"
|
|
|
|
RESULT_DIR="$ROOT_DIR/bench_results/mimalloc_suite_$(date +%Y%m%d_%H%M%S)"
|
|
mkdir -p "$RESULT_DIR"
|
|
|
|
echo "[info] Building HAKMEM shared library with PGO (for LD_PRELOAD)"
|
|
make -s pgo-profile-shared pgo-build-shared >/dev/null
|
|
|
|
BENCH_ROOT="$ROOT_DIR/mimalloc-bench"
|
|
BENCH_OUT="$BENCH_ROOT/out/bench"
|
|
|
|
if [[ ! -d "$BENCH_OUT" ]]; then
|
|
echo "[warn] mimalloc-bench/out/bench not found."
|
|
echo " Build it first: (may require sudo/network)"
|
|
echo " cd mimalloc-bench"
|
|
echo " ./build-bench-env.sh all"
|
|
exit 1
|
|
fi
|
|
|
|
pushd "$BENCH_OUT" >/dev/null
|
|
|
|
TESTS=(larson cfrac espresso xmalloc-test sh6bench sh8bench cscratch cthrash mstress malloc-large)
|
|
ALLOC_HAK=(sys) # sys + LD_PRELOAD=hakmem
|
|
ALLOC_BASE=(mi je sys) # reference allocators for comparison
|
|
PROCS=(1 4)
|
|
|
|
echo "[info] Running mimalloc-bench subset with HAKMEM (LD_PRELOAD)"
|
|
for p in "${PROCS[@]}"; do
|
|
log="$RESULT_DIR/hakmem_p${p}.log"
|
|
echo "[case] HAKMEM LD_PRELOAD --procs=$p | tests: ${TESTS[*]}" | tee -a "$log"
|
|
LD_PRELOAD="$ROOT_DIR/libhakmem.so" \
|
|
HAKMEM_WRAP_TINY=1 bash ../../bench.sh --procs="$p" "${ALLOC_HAK[@]}" "${TESTS[@]}" 2>&1 | tee -a "$log" || true
|
|
done
|
|
|
|
echo "[info] Running reference allocators (mi/je/sys)"
|
|
for p in "${PROCS[@]}"; do
|
|
log="$RESULT_DIR/ref_p${p}.log"
|
|
echo "[case] REF mi/je/sys --procs=$p | tests: ${TESTS[*]}" | tee -a "$log"
|
|
bash ../../bench.sh --procs="$p" "${ALLOC_BASE[@]}" "${TESTS[@]}" 2>&1 | tee -a "$log" || true
|
|
done
|
|
|
|
popd >/dev/null
|
|
|
|
echo "[info] Logs written to: $RESULT_DIR"
|
|
echo "[done] mimalloc-bench subset complete"
|