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>
2.0 KiB
2.0 KiB
hakmem Quick Reference - 速引きリファレンス
目的: 5分で理解したい人向けの簡易仕様
🚀 3階層構造
size ≤ 1KB → Tiny Pool (TLS Magazine)
1KB < size < 2MB → ACE Layer (7固定クラス)
size ≥ 2MB → Big Cache (mmap)
📊 サイズクラス詳細
Tiny Pool (8クラス)
8B, 16B, 32B, 64B, 128B, 256B, 512B, 1KB
ACE Layer (7クラス) ⭐ Bridge Classes!
2KB, 4KB, 8KB, 16KB, 32KB, 40KB, 52KB
^^^^^^ ^^^^^^
Bridge Classes (Phase 6.21追加)
Big Cache
≥2MB → mmap (BigCache)
⚡ 使い方
基本モード選択
export HAKMEM_MODE=balanced # 推奨
export HAKMEM_MODE=minimal # ベースライン
export HAKMEM_MODE=fast # 本番用
実行
# LD_PRELOADで全プログラムに適用
LD_PRELOAD=./libhakmem.so ./your_program
# ベンチマーク
./bench_comprehensive_hakmem --scenario tiny
# Bridge Classesテスト
./test_bridge
🏆 ベンチマーク結果
| テスト | 結果 | mimalloc比較 |
|---|---|---|
| 16B LIFO | ✅ 勝利 | +0.8% |
| 16B インターリーブ | ✅ 勝利 | +7% |
| 64B LIFO | ✅ 勝利 | +3% |
| 混合サイズ | ✅ 勝利 | +7.5% |
🔧 ビルド
make clean && make libhakmem.so
make test # 基本確認
make bench # 性能測定
📁 主要ファイル
hakmem.c - メイン
hakmem_tiny.c - 1KB以下
hakmem_pool.c - 1KB-32KB
hakmem_l25_pool.c - 64KB-1MB
hakmem_bigcache.c - 2MB以上
⚠️ 注意点
- 学習機能は無効化(DYN1/DYN2廃止)
- Call-siteプロファイリング不要(サイズのみ)
- Bridge Classesが勝利の秘訣
🎯 なぜ速いのか?
- TLS Active Slab - スレッド競合排除
- Bridge Classes - 32-64KBギャップ解消
- 単純なSACS-3 - 複雑な学習削除
以上!🎉