Use unaligned bit buffer iterators where possible#6880
Merged
robert3005 merged 4 commits intodevelopfrom Mar 11, 2026
Merged
Conversation
91a3c94 to
c79af28
Compare
Signed-off-by: Robert Kruszewski <github@robertk.io>
c79af28 to
7aa51ca
Compare
Merging this PR will degrade performance by 20.89%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | Simulation | chunked_varbinview_opt_canonical_into[(1000, 10)] |
3.8 ms | 3.3 ms | +15.82% |
| ⚡ | Simulation | chunked_varbinview_opt_canonical_into[(100, 100)] |
4.2 ms | 3.7 ms | +14.53% |
| ⚡ | Simulation | chunked_varbinview_opt_into_canonical[(100, 100)] |
4.2 ms | 3.7 ms | +14.41% |
| ⚡ | Simulation | chunked_varbinview_opt_into_canonical[(1000, 10)] |
3.8 ms | 3.3 ms | +15.77% |
| ⚡ | Simulation | varbinview_zip_block_mask |
27.4 ms | 24 ms | +14.29% |
| ❌ | Simulation | dict_canonicalize_zipfian[16, 1000] |
56.2 µs | 63.4 µs | -11.39% |
| ⚡ | Simulation | varbinview_zip_fragmented_mask |
31.5 ms | 28.1 ms | +12.18% |
| ❌ | Simulation | patched_take_200k_first_chunk_only |
4.8 ms | 5.4 ms | -10.68% |
| ❌ | Simulation | patched_take_200k_dispersed |
4.7 ms | 5.6 ms | -16.56% |
| ❌ | Simulation | take_200k_first_chunk_only |
3.3 ms | 4.2 ms | -20.89% |
| ❌ | Simulation | take_200k_dispersed |
3.6 ms | 4.5 ms | -19.6% |
| ⚡ | Simulation | bitwise_and_vortex_buffer[16384] |
13.7 µs | 11 µs | +23.77% |
| ⚡ | Simulation | bitwise_and_vortex_buffer[65536] |
40.9 µs | 29.7 µs | +37.42% |
| ⚡ | Simulation | bitwise_not_vortex_buffer[16384] |
10.4 µs | 9.3 µs | +12.14% |
| ⚡ | Simulation | bitwise_not_vortex_buffer[2048] |
5.5 µs | 4.6 µs | +18.18% |
| ⚡ | Simulation | bitwise_or_vortex_buffer[16384] |
13.7 µs | 11.1 µs | +23.71% |
| ⚡ | Simulation | bitwise_or_vortex_buffer[65536] |
40.9 µs | 29.8 µs | +37.38% |
| ⚡ | Simulation | bitwise_not_vortex_buffer[65536] |
26.7 µs | 21.5 µs | +24.23% |
| ⚡ | Simulation | from_iter_bit_buffer[128] |
5.3 µs | 4.8 µs | +10.18% |
Comparing rk/faster_bit_buffer (1f588c9) with develop (11a2733)
Footnotes
-
1466 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. ↩
AdamGS
approved these changes
Mar 11, 2026
Contributor
Author
|
I have to revert the last commit before merging |
This reverts commit 8f132d9.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use unalingned bit iterators where possible, they are faster as they avoid
unaligned reads. They're always fine to use for unary operations and can be used
for n-ary operations if all buffers are aligned
Summary
We used to have this optimisation when we added BitBuffer but we reverted to
arrow implementation of bit iterators and it got lost in the process.
Closes: #6836
Testing
Existing tests
Signed-off-by: Robert Kruszewski github@robertk.io