Skip to content

bench(buffer): drop zero-size cases from allocation benchmarks - #9815

Open
joseph-isaacs wants to merge 1 commit into
developfrom
claude/allocate-drop-bytes-benchmarks-b267d9
Open

bench(buffer): drop zero-size cases from allocation benchmarks#9815
joseph-isaacs wants to merge 1 commit into
developfrom
claude/allocate-drop-bytes-benchmarks-b267d9

Conversation

@joseph-isaacs

@joseph-isaacs joseph-isaacs commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Removed noisy benchmark

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
@codspeed-hq

codspeed-hq Bot commented Sep 9, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 2.65%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 4 improved benchmarks
❌ 2 regressed benchmarks
✅ 2168 untouched benchmarks
🆕 6 new benchmarks
⏩ 231 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

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

Open in CodSpeed

Footnotes

  1. 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.

  2. 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.

@joseph-isaacs
joseph-isaacs enabled auto-merge (squash) September 9, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants