Follow-up to #30 (zero-copy stream parsing). Everything here must be reproducible — a committed benchmark + a documented command + pasted numbers, not a belief.
Why
#30 traded ~25% parse CPU (CodSpeed: controller_idx_sigs_1sig −27.7%, multi_group_controller_witness −21.7%) for fewer heap allocations (~N → 1 per multi-group message). The allocation reduction is proven (tests/allocation.rs, mutation-verified). But the payoff is unproven: no benchmark yet shows fewer allocations translating into a throughput or latency win anywhere. Single-threaded benches show a net regression (correct-but-slower). So "was #30 worth it?" is currently a belief, not a measured result — which violates the reproducibility bar.
Goal
Make "does the zero-copy allocation reduction actually pay off?" a reproducible measurement.
The measurement (the one place it should win)
Add a committed, deterministic benchmark that parses many small streams concurrently across N threads, comparing:
- branch (copy-once: 1 alloc/stream), vs
origin/main behavior (per-group copy: N allocs/stream).
Under multi-thread allocator contention, N-allocs-per-stream should hit the global allocator lock far more than 1-alloc-per-stream — this is the scenario where fewer allocations converts to throughput. Measure wall-clock throughput and allocation counts at increasing thread counts (1, 2, 4, 8…).
Acceptance criteria (reproducible)
Pointers
Why
#30 traded ~25% parse CPU (CodSpeed:
controller_idx_sigs_1sig−27.7%,multi_group_controller_witness−21.7%) for fewer heap allocations (~N → 1 per multi-group message). The allocation reduction is proven (tests/allocation.rs, mutation-verified). But the payoff is unproven: no benchmark yet shows fewer allocations translating into a throughput or latency win anywhere. Single-threaded benches show a net regression (correct-but-slower). So "was #30 worth it?" is currently a belief, not a measured result — which violates the reproducibility bar.Goal
Make "does the zero-copy allocation reduction actually pay off?" a reproducible measurement.
The measurement (the one place it should win)
Add a committed, deterministic benchmark that parses many small streams concurrently across N threads, comparing:
origin/mainbehavior (per-group copy: N allocs/stream).Under multi-thread allocator contention, N-allocs-per-stream should hit the global allocator lock far more than 1-alloc-per-stream — this is the scenario where fewer allocations converts to throughput. Measure wall-clock throughput and allocation counts at increasing thread counts (1, 2, 4, 8…).
Acceptance criteria (reproducible)
origin/mainbehavior) across thread counts.no_std/constrained-allocator behavior if feasible.Pointers
tests/allocation.rs(alloc-count harness, thread-local counting allocator — reuse it).benches/stream.rs(stream_parse_scaling), CodSpeed on PR perf(#30): zero-copy stream parsing + test/coverage/mutation safeguards #63.