From 642e1938e4448a1d86ebe8b595d732f69624d203 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 9 Sep 2026 16:44:07 +0000 Subject: [PATCH] bench(buffer): drop zero-size cases from allocation benchmarks 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 Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01Xw1XbsN6sxmLiJWyhAYM98 --- vortex-buffer/benches/allocation.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vortex-buffer/benches/allocation.rs b/vortex-buffer/benches/allocation.rs index 6cd923b5dfb..f9fca603f1a 100644 --- a/vortex-buffer/benches/allocation.rs +++ b/vortex-buffer/benches/allocation.rs @@ -10,7 +10,7 @@ use vortex_buffer::Buffer; use vortex_buffer::BufferAllocatorRef; use vortex_buffer::BufferMut; -const SIZES: &[usize] = &[0, 64, 256, 1024, 16_384, 65_536]; +const SIZES: &[usize] = &[64, 256, 1024, 16_384, 65_536]; fn main() { divan::main();