zhuqi-lucas opened a new pull request, #7962:
URL: https://github.com/apache/arrow-rs/pull/7962

   # Which issue does this PR close?
   
   This PR is follow-up for:
   
   https://github.com/apache/arrow-rs/pull/7937 
   
   I want to experiment the performance for Using word-level (u64) bit scanning:
   
   Details:
   
    https://github.com/apache/arrow-rs/pull/7937#pullrequestreview-3029859465
   
   # Rationale for this change
   
   Using word-level (u64) bit scanning
   
   And use Brian Kernighan’s algorithm, details comments:
   
             // Iterate over each set bit in `z` (null mask) using a 
bit-parallel
               // approach (Brian Kernighan’s algorithm):
               // - `z.trailing_zeros()` finds the index of the 
least-significant 1-bit,
               //   which corresponds to a null element’s position relative to 
`base`.
               // - Writing `(base + tz)` records the absolute index of this 
null.
               // - `z &= z - 1` clears that lowest set bit, so on next 
iteration we
               //   process the next null bit without scanning through all bits 
one-by-one.
               // This method avoids per-bit branching and runs in O(k) time 
for k nulls,
               // making it much faster than checking every position, 
especially when nulls are sparse.
   
   # What changes are included in this PR?
   
   There is no need to duplicate the description in the issue here but it is 
sometimes worth providing a summary of the individual changes in this PR.
   
   # Are these changes tested?
   
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are 
they covered by existing tests)?
   
   # Are there any user-facing changes?
   
   If there are user-facing changes then we may require documentation to be 
updated before approving the PR.
   
   If there are any breaking changes to public APIs, please call them out.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to