Skip to content

feat(buffer): add allocator-backed storage - #9668

Open
gatesn wants to merge 13 commits into
developfrom
ngates/buffer-allocator-core
Open

feat(buffer): add allocator-backed storage#9668
gatesn wants to merge 13 commits into
developfrom
ngates/buffer-allocator-core

Conversation

@gatesn

@gatesn gatesn commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Add allocator-backed storage to vortex-buffer.

Design: vortex-data/rfcs#65

Changes

  • Use allocator_api2 for owned buffers.
  • Keep external buffers zero-copy.
  • Preserve runtime alignment and bytes/Arrow interop.
  • Add allocator-aware constructors and tests.

API Changes

Owned buffers no longer use bytes::Bytes as storage. The bytes crate remains for interop.

@gatesn gatesn mentioned this pull request Aug 27, 2026
5 tasks
@gatesn
gatesn marked this pull request as ready for review August 27, 2026 19:24
@gatesn
gatesn requested a review from AdamGS August 27, 2026 19:24
@gatesn
gatesn force-pushed the ngates/buffer-allocator-core branch from 0f5a07e to 4911c36 Compare August 27, 2026 19:38
@codspeed-hq

codspeed-hq Bot commented Aug 27, 2026

Copy link
Copy Markdown

Merging this PR will regress 20 benchmarks

⚠️ 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

⚡ 81 improved benchmarks
❌ 20 regressed benchmarks
✅ 2110 untouched benchmarks
⏩ 64 skipped benchmarks1
🗄️ 5 archived benchmarks run2

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation runend_compress_u32 398.3 µs 625.3 µs -36.3%
Simulation non_nullable[32] 262.7 µs 398.5 µs -34.08%
Simulation execute_scalar_struct_simple 111.5 µs 167.4 µs -33.41%
Simulation non_nullable[2] 365.4 µs 537.6 µs -32.04%
Simulation decompress[u32, (4000, 1024)] 55.7 µs 79.1 µs -29.61%
Simulation nullable[2] 365.6 µs 499.3 µs -26.78%
Simulation nullable[256] 259.3 µs 354.2 µs -26.78%
Simulation nullable[32] 264.3 µs 360.5 µs -26.69%
WallTime mul_u64_nonnull_neon 15.1 µs 20.3 µs -25.69%
Simulation decompress[u8, (1000, 4)] 47 µs 63 µs -25.41%
Simulation non_nullable[256] 258 µs 341 µs -24.34%
WallTime lanezip_checked_add_u32_avx512[16384] 3.5 µs 4.5 µs -22.45%
Simulation decode_varbin[(1000, 2)] 52.5 µs 66.2 µs -20.77%
WallTime mul_i64_nonnull_neon 17.1 µs 20.7 µs -17.64%
WallTime arrow_checked_add_u32_avx2[16384] 17.7 µs 21.4 µs -17.03%
WallTime multiply_shapes_neon[(16384, PerRowPerRow)] 17.3 µs 20.7 µs -16.47%
Simulation compress[(4000, 4)] 194.4 µs 232.2 µs -16.25%
Simulation compress[(1000, 4)] 118.8 µs 140 µs -15.13%
Simulation compress[(10000, 4)] 496 µs 575.4 µs -13.8%
Simulation push_n_vortex_buffer[u32, 128] 2.8 µs 3.1 µs -10.96%
... ... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing ngates/buffer-allocator-core (719ac2e) with develop (01f147a)

Open in CodSpeed

Footnotes

  1. 64 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. 5 benchmarks were run, but are now archived. If they were deleted in another branch, consider rebasing to remove them from the report. Instead if they were added back, click here to restore them.

@gatesn
gatesn force-pushed the ngates/buffer-allocator-core branch 2 times, most recently from 85d55a8 to 94c47cb Compare August 27, 2026 21:38
@gatesn gatesn added the changelog/feature A new feature label Aug 27, 2026
pub(crate) length: usize,
pub(crate) alignment: Alignment,
pub(crate) _marker: PhantomData<T>,
pub(crate) backing: Arc<BufferBacking>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since I ran through experiments with this in the past - the Arc overhead here for small length dominates your allocations. tokio::Bytes plays game with pointer masking and stores AtomicPtr<()> and another pointer to avoid synchronistaion for trivial cases

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep... that's causing the slow downs I believe

@gatesn
gatesn force-pushed the ngates/buffer-allocator-core branch 5 times, most recently from 15a66c6 to 6331364 Compare August 28, 2026 20:41
gatesn added 13 commits August 28, 2026 21:00
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
This reverts commit 1186945.

Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
This reverts commit b553828.

Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
@gatesn
gatesn force-pushed the ngates/buffer-allocator-core branch from 719ac2e to bb83f1e Compare August 29, 2026 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants