Phase 4 D3 Design: Alloc Gate Shape

This commit is contained in:
Moe Charm (CI)
2025-12-14 00:05:11 +09:00
parent 141cd8a5be
commit b40aff290e
6 changed files with 440 additions and 27 deletions

View File

@ -303,18 +303,20 @@ static inline void* tiny_alloc_gate_fast(size_t size)
---
### Phase 3 D3: Alloc Gate Specialization (MEDIUM PRIORITY)
**Target**: `tiny_alloc_gate_fast()` for LEGACY-only route
**Target**: `tiny_alloc_gate_fast()` の分岐形を最短化MIXED 向け)
**Expected Gain**: +1-2%
**Risk**: LOW
**Effort**: 2-3 hours
**Implementation**:
1. Create `tiny_alloc_gate_fast_legacy()` specialized variant
2. Eliminate ROUTE_POOL_ONLY and ROUTE_TINY_FIRST branches
3. Use in MIXED profile where all classes are LEGACY
1. New ENV gate: `HAKMEM_ALLOC_GATE_SHAPE=0/1`
2. `tiny_route_get()` を避け、`g_tiny_route[]` の直接参照に置換release logging branch を回避)
3. `ROUTE_POOL_ONLY` は必ず尊重(`HAKMEM_TINY_PROFILE=hot/off` を壊さない)
4. A/B test: BASELINE vs D3
**ENV Gate**: `HAKMEM_ALLOC_GATE_LEGACY_ONLY=1` (default: 0)
**Design**: `docs/analysis/PHASE4_D3_ALLOC_GATE_SPECIALIZATION_1_DESIGN.md`
**ENV Gate**: `HAKMEM_ALLOC_GATE_SHAPE=0/1` (default: 0)
---
@ -376,7 +378,7 @@ static inline void* tiny_alloc_gate_fast(size_t size)
2. **Optional**: Phase 3 D3 (Alloc gate specialization) - pending perf validation
- Only proceed if perf shows ≥5% self% in alloc gate
- ENV: `HAKMEM_ALLOC_GATE_LEGACY_ONLY=0/1`
- ENV: `HAKMEM_ALLOC_GATE_SHAPE=0/1`
3. **Phase 4 Planning**: If no more 5%+ targets, prepare Phase 4 roadmap