XPerf
LanguagesZigEvidence

zp-fixed-size-alloc-hot — fixed-size-alloc-in-loop

Claim

GPA alloc+free 256B vs warm buffer-pool hit under Zig 0.17.0 -Ofast on this Linux machine shows a clear before/after wall-clock gap.

How measured

  • Harness: packages/zperf/examples/bench/evidence_fill.zig (rule zp-fixed-size-alloc-hot cases)
  • Build: zig build-exe -Ofast · optimize_mode=fast
  • Timing: Io.Clock awake; warm=2; median of 9 rounds
  • before: fixed_alloc_free_loop
  • after: buffer_pool_hit
  • ops=100000
  • Raw: zp-fixed-size-alloc-hot.jsonl

Runtime (this evidence file)

FieldValue
When2026-10-21 Asia/Shanghai (JSONL ts is UTC)
Zig0.17.0 · fast
Median before~2.001 ms
Median after~0.236 ms
ratio before/after~8.48×

Lint mapping

zperf-lint zp-fixed-size-alloc-hot / fixed-size-alloc-in-loop. Default severity in rules.zig is info; see evidence-policy for keep/escalate. Evidence exists and agrees directionally.

Verdict

Agree ~8.5× (aligns with p20 pool vs GPA).

Limits

Pool miss still hits GPA; size-class pools matter.