perf(yip-bench): #58 MAC-candidate spike (measure-only) #114

Merged
vxfemboy merged 1 commit from perf/58-mac-candidate-spike into main 2026-07-26 03:06:03 +00:00
vxfemboy commented 2026-07-26 02:42:07 +00:00 (Migrated from github.com)

Closes the investigation half of #58: measure candidate MACs on the target box before any wire-format change.

What

New isolated criterion microbench (crates/yip-bench/benches/mac_candidates.rs) timing three keyed MACs over the exact region yip-wire authenticates (header‖symbol, 8-byte tag):

  • siphash24 — today's auth_tag construction (baseline)
  • siphash13 — SipHash-1-3, drop-in from the same crate
  • blake3_keyed — keyed BLAKE3 (AVX2 SIMD), truncated to 8 bytes

Results

Measured on the EPYC target box (the 4b profile box) and a dev box — ratios agree:

covered candidate EPYC ns vs SipHash-2-4
1415 B siphash13 420 0.55× (−45%)
1415 B siphash24 (today) 758 1.00×
1415 B blake3_keyed 1888 2.49× (slower)
63 B siphash13 31.8 0.63×
63 B siphash24 50.5 1.00×
63 B blake3_keyed 104 2.06× (slower)

Findings

  1. SipHash-1-3 is the only real lever: ~45% cheaper at packet size → ≈4% of receiver CPU saved. Confirms the parked ~4.5% estimate empirically.
  2. BLAKE3 rejected on data, not just principle: ~2.5× slower at a 1.4 KB symbol — per-call key-schedule + finalize overhead dominates its SIMD throughput at packet sizes.

Scope

No wire-format change. The remaining decision (adopt a reduced-round MAC on security-critical code for ~4% CPU that did not move end-to-end throughput on RTT/window-capped boxes) is the parked swap call. Full write-up in crates/yip-bench/mac-candidates-58.md.

Closes the investigation half of #58: **measure candidate MACs on the target box before any wire-format change.** ## What New isolated criterion microbench (`crates/yip-bench/benches/mac_candidates.rs`) timing three keyed MACs over the exact region yip-wire authenticates (header‖symbol, 8-byte tag): - `siphash24` — today's `auth_tag` construction (baseline) - `siphash13` — SipHash-1-3, drop-in from the same crate - `blake3_keyed` — keyed BLAKE3 (AVX2 SIMD), truncated to 8 bytes ## Results Measured on the EPYC target box (the 4b profile box) **and** a dev box — ratios agree: | covered | candidate | EPYC ns | vs SipHash-2-4 | |--:|--|--:|--:| | 1415 B | **siphash13** | **420** | **0.55× (−45%)** | | 1415 B | siphash24 (today) | 758 | 1.00× | | 1415 B | blake3_keyed | 1888 | 2.49× (slower) | | 63 B | siphash13 | 31.8 | 0.63× | | 63 B | siphash24 | 50.5 | 1.00× | | 63 B | blake3_keyed | 104 | 2.06× (slower) | ## Findings 1. **SipHash-1-3 is the only real lever:** ~45% cheaper at packet size → ≈4% of receiver CPU saved. Confirms the parked ~4.5% estimate empirically. 2. **BLAKE3 rejected on data, not just principle:** ~2.5× *slower* at a 1.4 KB symbol — per-call key-schedule + finalize overhead dominates its SIMD throughput at packet sizes. ## Scope No wire-format change. The remaining decision (adopt a reduced-round MAC on security-critical code for ~4% CPU that did **not** move end-to-end throughput on RTT/window-capped boxes) is the parked *swap* call. Full write-up in `crates/yip-bench/mac-candidates-58.md`.
Sign in to join this conversation.
No description provided.