feat: BMI for bit filtering#10136
Draft
devanbenz wants to merge 3 commits into
Draft
Conversation
devanbenz
commented
Jun 12, 2026
| /// Replace with `value.compress(mask)` when `uint_gather_scatter_bits` | ||
| /// is stabilised: <https://github.com/rust-lang/rust/issues/149069> | ||
| #[inline] | ||
| pub fn compress(value: u64, mask: u64) -> u64 { |
Author
There was a problem hiding this comment.
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.
DRAFT
This commit adds the ability for bit filtering to be done using the
_pext_u64BMI.Right now this PR is directly copying the
bit_util.rscode from: https://github.com/apache/arrow-rs/pull/9848/changes#diff-f2fe5b601534125d0ba033762b62db93ae2f81c71a543b6694df33773ebfa308R939-R976 -- I've just moved thecompressfunction in toarrow-buffer. This draft PR is mostly meant to allow for me to benchmark on my ARM machine and x86_64 machine.I noticed while bench-marking using the BMI path (
filter_bits_compress) leads to a regression when we have a very dense or a very sparse filter mask. Besides those two outliers we gain a large performance gain from BMI.