bench(buffer): drop zero-size cases from allocation benchmarks - #9815
bench(buffer): drop zero-size cases from allocation benchmarks#9815joseph-isaacs wants to merge 1 commit into
Conversation
Size zero is a degenerate input for every library compared in this file. Vortex short-circuits in `Allocation::allocate_impl` and returns a dangling pointer, `BytesMut::with_capacity(0)` returns the constant empty buffer, arrow's `MutableBuffer` also uses a dangling pointer, and `vec![0u8; 0]` never allocates. None of the thirteen `[0]` cases measured an allocation, which is the comparison this benchmark exists to make. What they did measure was a handful of instructions of struct construction and drop. Under CodSpeed simulation mode a body that small turns any inlining or register-allocation change into a large relative swing, so the series were noisy without carrying signal. The empty-buffer fast path is a correctness property covered by tests. Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk> Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xw1XbsN6sxmLiJWyhAYM98
Merging this PR will degrade performance by 2.65%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | allocate_freeze_drop_arrow[64] |
3.6 µs | 7 µs | -48.9% |
| ❌ | Simulation | decompress[u64, (4000, 1024)] |
70.8 µs | 86 µs | -17.73% |
| ⚡ | Simulation | allocate_drop_vortex[1024] |
6.4 µs | 5.2 µs | +23.77% |
| ⚡ | Simulation | allocate_drop_arrow[64] |
8 µs | 6.5 µs | +23.21% |
| ⚡ | Simulation | allocate_freeze_drop_vortex_custom[1024] |
8.1 µs | 6.8 µs | +18.08% |
| ⚡ | WallTime | mul_u32_nonnull_avx512 |
6.2 µs | 5.6 µs | +12.43% |
| 🆕 | WallTime | dict_canonicalize_gt_u8_neon[1000000] |
N/A | 559.8 µs | N/A |
| 🆕 | WallTime | dict_canonicalize_gt_u8_neon[16000000] |
N/A | 9.4 ms | N/A |
| 🆕 | WallTime | dict_canonicalize_gt_u8_avx512[1000000] |
N/A | 419.7 µs | N/A |
| 🆕 | WallTime | dict_canonicalize_gt_u8_avx512[16000000] |
N/A | 6.8 ms | N/A |
| 🆕 | WallTime | dict_canonicalize_gt_u8_avx2[1000000] |
N/A | 419.9 µs | N/A |
| 🆕 | WallTime | dict_canonicalize_gt_u8_avx2[16000000] |
N/A | 6.8 ms | N/A |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing claude/allocate-drop-bytes-benchmarks-b267d9 (642e193) with develop (ae8fddc)2
Footnotes
-
231 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
-
No successful run was found on
develop(2a5b1a7) during the generation of this report, so ae8fddc was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
Removed noisy benchmark