Commit Graph

1 Commits

Author SHA1 Message Date
6f8742582b Phase 5-Step3: Mid/Large Config Box (future workload optimization)
Add compile-time configuration for Mid/Large allocation paths using Box pattern.

Implementation:
- Created core/box/mid_large_config_box.h
- Dual-mode config: PGO (compile-time) vs Normal (runtime)
- Replace HAK_ENABLED_* checks with MID_LARGE_* macros
- Dead code elimination when HAKMEM_MID_LARGE_PGO=1

Target Checks Eliminated (PGO mode):
- MID_LARGE_BIGCACHE_ENABLED (BigCache for 2MB+ allocations)
- MID_LARGE_ELO_ENABLED (ELO learning/threshold)
- MID_LARGE_ACE_ENABLED (ACE allocator gate)
- MID_LARGE_EVOLUTION_ENABLED (Evolution sampling)

Files:
- core/box/mid_large_config_box.h (NEW) - Config Box pattern
- core/hakmem_build_flags.h - Add HAKMEM_MID_LARGE_PGO flag
- core/box/hak_alloc_api.inc.h - Replace 2 checks (ELO, BigCache)
- core/box/hak_free_api.inc.h - Replace 2 checks (BigCache)

Performance Impact:
- Current workloads (16B-8KB): No effect (checks not in hot path)
- Future workloads (2MB+): Expected +2-4% via dead code elimination

Box Pattern:  Single responsibility, clear contract, testable

Note: Config Box infrastructure ready for future large allocation benchmarks.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 14:39:07 +09:00