Files
hakmem/docs/analysis/TINY_HEADER_WRITE_ALWAYS_INLINE_A3_DESIGN.md
Moe Charm (CI) d54893ea1d Phase 3 C3: Static Routing A/B Test ADOPT (+2.20% Mixed gain)
Step 2 & 3 Complete:
- A/B test (Mixed 10-run): STATIC_ROUTE=0 (38.91M) → =1 (39.77M) = +2.20% avg
  - Median gain: +1.98%
  - Result:  GO (exceeds +1.0% threshold)

- Decision:  ADOPT into MIXED_TINYV3_C7_SAFE preset
  - bench_profile.h line 77: HAKMEM_TINY_STATIC_ROUTE=1 default
  - Learner auto-disables static route when HAKMEM_SMALL_LEARNER_V7_ENABLED=1

Implementation Summary:
- core/box/tiny_static_route_box.{h,c}: Research box (Step 1A)
- core/front/malloc_tiny_fast.h: Route lookup integration (Step 1B, lines 249-256)
- core/bench_profile.h: Bench sync + preset adoption

Cumulative Phase 2-3 Gains:
- B3 (Routing shape): +2.89%
- B4 (Wrapper split): +1.47%
- C3 (Static routing): +2.20%
- Total: ~6.8% (35.2M → ~39.8M ops/s)

Next: Phase 3 C1 (TLS Prefetch, expected +2-4%)

🤖 Generated with Claude Code

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2025-12-13 18:46:11 +09:00

853 B
Raw Blame History

Phase 1 A3: tiny_region_id_write_header() always_inline設計メモ + A/B

目的

Tiny の header write を “関数呼び出し” から解放し、ホットパスの命令数を削る(期待: +1〜2%)。

方針

  • tiny_region_id_write_header()__attribute__((always_inline)) にする(研究箱)
  • ENV/ビルドフラグで即切り戻せる前提

A/B 結果

  • Mixed10-run: 49.53M → 47.55M ops/s-4.00%
  • C6-heavy5-run: 23.49M → 24.93M ops/s+6.00%

判定

  • NO-GOMixed 回帰が閾値超え)
  • Decision: research box freezedefault OFF

所見

Mixed は I-cache 圧力が支配的で、強制 inline によるコード膨張が即回帰につながった。 C6-heavy はワーキングセットが小さく、inline の勝ちが出やすい。