Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnalignedBitChunkIterator to that iterates through already aligned u64 blocks #1227

Closed
tustvold opened this issue Jan 23, 2022 · 0 comments · Fixed by #1228
Closed

UnalignedBitChunkIterator to that iterates through already aligned u64 blocks #1227

tustvold opened this issue Jan 23, 2022 · 0 comments · Fixed by #1228

Comments

@tustvold
Copy link
Contributor

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

BitChunks and the associated BitChunkIterator allow iterating over a bitmask in u64 sized blocks. Unfortunately this comes at the cost of unaligned reads, and non-trivial bit-shuffling for every u64 block. This is advantageous when alignment is important, for example when writing the data to another buffer, but is unnecessary when computing bit counts or set bit offsets.

Describe the solution you'd like

Add an UnalignedBitChunkIterator that iterates through already aligned u64 blocks, potentially with padding either side. SlicesIterator should then be updated to use this.

@tustvold tustvold added the enhancement Any new improvement worthy of a entry in the changelog label Jan 23, 2022
tustvold added a commit to tustvold/arrow-rs that referenced this issue Jan 23, 2022
tustvold added a commit to tustvold/arrow-rs that referenced this issue Jan 28, 2022
tustvold added a commit to tustvold/arrow-rs that referenced this issue Jan 28, 2022
alamb added a commit that referenced this issue Feb 2, 2022
* Add UnalignedBitChunks (#1227)

* Clippy

* Fix flaky test

* Improve test legibility

* Fix SlicesIterator offset direction

* Format

* Fix byte-aligned termination

* Test edge-cases

* More tests

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>

* Review feedback

* Make UnalignedBitChunkIterator crate local

Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
@alamb alamb changed the title UnalignedBitChunkIterator UnalignedBitChunkIterator to that iterates through already aligned u64 blocks Feb 3, 2022
@alamb alamb removed the enhancement Any new improvement worthy of a entry in the changelog label Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants