Skip to content

move towards BitBuffer/{Mut}View over owned bit buffers#8208

Merged
joseph-isaacs merged 4 commits into
developfrom
claude/sweet-ptolemy-bMwms
Jun 2, 2026
Merged

move towards BitBuffer/{Mut}View over owned bit buffers#8208
joseph-isaacs merged 4 commits into
developfrom
claude/sweet-ptolemy-bMwms

Conversation

@joseph-isaacs

@joseph-isaacs joseph-isaacs commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR introduces BitBufferView<'a> and BitBufferMutView<'a> as borrowing analogues to the owned BitBuffer and BitBufferMut types. These new types enable zero-copy reading and in-place modification of packed bitsets without cloning the underlying ByteBuffer.

This View will replace BitBuffer after the migration.

@codspeed-hq

codspeed-hq Bot commented Jun 2, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 17.78%

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

⚡ 8 improved benchmarks
✅ 1267 untouched benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation chunked_bool_canonical_into[(1000, 10)] 45.4 µs 30.3 µs +49.66%
Simulation chunked_varbinview_into_canonical[(1000, 10)] 211.8 µs 176.2 µs +20.24%
Simulation decompress_rd[f64, (10000, 0.0)] 140.6 µs 123.6 µs +13.74%
Simulation decompress_rd[f64, (10000, 0.01)] 140.6 µs 123.6 µs +13.72%
Simulation decompress_rd[f64, (10000, 0.1)] 140.9 µs 124 µs +13.63%
Simulation chunked_varbinview_canonical_into[(100, 100)] 309.2 µs 273.5 µs +13.05%
Simulation bitwise_not_vortex_buffer_mut[128] 275.3 ns 246.1 ns +11.85%
Simulation extend_from_array_non_zctl_overlapping[(10000, 8)] 5.3 ms 4.8 ms +10.74%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing claude/sweet-ptolemy-bMwms (25d93a3) with develop (f35ef50)

Open in CodSpeed

@joseph-isaacs joseph-isaacs marked this pull request as draft June 2, 2026 10:14
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
@joseph-isaacs joseph-isaacs force-pushed the claude/sweet-ptolemy-bMwms branch from caabf8a to 599ed2b Compare June 2, 2026 11:19
…my-bMwms

Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>

# Conflicts:
#	vortex-cuda/src/arrow/canonical.rs
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
- arrow/canonical.rs:145 still referenced a bare `offset` local that no
  longer exists after the destructure was updated to `{ bits, meta }`.
  Use `meta.offset()` so the validity buffer export matches the bit offset
  that's passed to `export_fixed_size` on the next line.
- canonical.rs:80 passes the `meta` fields to
  `BitBuffer::new_with_offset(buffer, len, offset)` in the wrong order
  (offset was being passed as len, and vice versa). Swap them.

Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
@joseph-isaacs joseph-isaacs added the changelog/feature A new feature label Jun 2, 2026
@joseph-isaacs joseph-isaacs marked this pull request as ready for review June 2, 2026 11:30
@joseph-isaacs joseph-isaacs requested a review from robert3005 June 2, 2026 11:30
@joseph-isaacs joseph-isaacs changed the title Add BitBufferView and BitBufferMutView for zero-copy bitset borrowing move towards BitBuffer/{Mut}View over owned bit buffers Jun 2, 2026
@joseph-isaacs joseph-isaacs merged commit 5aa3f3d into develop Jun 2, 2026
73 of 74 checks passed
@joseph-isaacs joseph-isaacs deleted the claude/sweet-ptolemy-bMwms branch June 2, 2026 12:50
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