Skip to content

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

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

feat(buffer): add allocator-backed storage#9668
gatesn wants to merge 17 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 degrade performance by 6.5%

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

⚡ 60 improved benchmarks
❌ 124 regressed benchmarks
✅ 2027 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 decompress[datetime_for_bp] 220.5 µs 405.3 µs -45.6%
Simulation new_bp_prim_test_between[i64, 2048] 89.9 µs 153.8 µs -41.56%
Simulation new_alp_prim_test_between[f64, 2048] 106.7 µs 171.2 µs -37.68%
Simulation decompress[alp_for_bp_f64] 146 µs 225.2 µs -35.15%
Simulation decompress_rd[f64, (2000, 0.01)] 121.6 µs 187.3 µs -35.07%
Simulation decompress_rd[f64, (2000, 0.1)] 121.7 µs 187.3 µs -35.03%
Simulation decompress_rd[f64, (2000, 0.0)] 121.7 µs 187.2 µs -35.01%
Simulation execute_scalar_struct_simple 111.1 µs 168.8 µs -34.18%
Simulation decompress[u16, (4000, 256)] 37.5 µs 55.7 µs -32.66%
Simulation chunked_opt_bool_into_canonical[(1000, 10)] 85.7 µs 120.8 µs -29.04%
Simulation new_bp_prim_test_between[i64, 16384] 170.5 µs 236.8 µs -27.99%
Simulation alp_rd_decompress_f64 169.6 µs 235.5 µs -27.98%
Simulation compare[1] 211.1 µs 287.3 µs -26.51%
Simulation new_alp_prim_test_between[f64, 16384] 193.3 µs 258.5 µs -25.22%
Simulation compare[1] 207.2 µs 272.3 µs -23.89%
Simulation compare[2] 213 µs 278.6 µs -23.57%
Simulation compare[2] 216.1 µs 281.8 µs -23.33%
Simulation compare[3] 220.4 µs 285.8 µs -22.89%
Simulation compare[3] 223.4 µs 289.2 µs -22.74%
Simulation compare[4] 225.9 µs 291.4 µs -22.47%
... ... ... ... ... ...

ℹ️ 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 (235c4c8) with develop (a745604)

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 6 times, most recently from 719ac2e to bb83f1e Compare August 29, 2026 01:01
gatesn added 15 commits August 28, 2026 22:45
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>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
Signed-off-by: Nicholas Gates <nick@nickgates.com>
gatesn added 2 commits August 28, 2026 22:45
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 7ed68a3 to 235c4c8 Compare August 29, 2026 02:45
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