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:
49
benchmarks/scripts/utils/parse_mimalloc_logs.py
Normal file
49
benchmarks/scripts/utils/parse_mimalloc_logs.py
Normal file
@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env python3
|
||||
import sys, re, os, glob
|
||||
|
||||
# Parse mimalloc-bench logs and print CSV: file,allocator,procs,test,throughput
|
||||
# Assumes lines like: "Throughput = 1234567 operations per second, ..."
|
||||
|
||||
def infer_allocator_from_file(path):
|
||||
fn = os.path.basename(path)
|
||||
if fn.startswith('hakmem_'): return 'hakmem'
|
||||
if fn.startswith('mimalloc_'): return 'mimalloc'
|
||||
if fn.startswith('jemalloc_'): return 'jemalloc'
|
||||
if fn.startswith('system_'): return 'system'
|
||||
# fallback: try substring
|
||||
for k in ('hakmem','mimalloc','jemalloc','system'):
|
||||
if k in fn: return k
|
||||
return 'unknown'
|
||||
|
||||
def infer_procs_from_file(path):
|
||||
m = re.search(r'procs=([0-9,]+)', os.path.basename(path))
|
||||
return m.group(1) if m else ''
|
||||
|
||||
def parse_file(path):
|
||||
alloc = infer_allocator_from_file(path)
|
||||
procs = infer_procs_from_file(path)
|
||||
test = ''
|
||||
with open(path,'r',errors='ignore') as f:
|
||||
for line in f:
|
||||
tl = line.strip()
|
||||
m = re.search(r'^Test\s*:\s*(\S+)', tl)
|
||||
if m: test = m.group(1)
|
||||
m2 = re.search(r'Throughput\s*=\s*([0-9]+)\s+operations per second', tl)
|
||||
if m2:
|
||||
thr = int(m2.group(1))
|
||||
yield (path, alloc, procs, test, thr)
|
||||
|
||||
def main():
|
||||
if len(sys.argv) != 2:
|
||||
print(f"usage: {sys.argv[0]} <log_dir>")
|
||||
sys.exit(1)
|
||||
logdir = sys.argv[1]
|
||||
files = sorted(glob.glob(os.path.join(logdir,'*.log')))
|
||||
print('file,allocator,procs,test,throughput_ops_per_sec')
|
||||
for fp in files:
|
||||
for rec in parse_file(fp):
|
||||
print(','.join(str(x) for x in rec))
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user