This repository has been archived by the owner on Feb 18, 2024. It is now read-only.
Improved performance of concatenating non-aligned validities (15x) #291
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.
This PR significantly improves the performance of concatenating arrays whose lengths are not a multiple of 8 by improving the performance of concatenating bitmaps.
Before this PR, we concatenated bitmaps by iterating bit by bit and setting bit by bit. However, there is a more efficient way of doing this via byte operations. Specifically, given a mutable bitmap
[10101000, --101010]
(length = 8+6=14
) a bitmap can be concatenated to by shifts. E.g.[00000011, a, b, ..., c]
can be concatenated to it by something like00000011 << 6
and OR ita
with00000011
with an offset of 2 and appendb
witha
with an offset of 2 and appendc
This results in a significantly less number of instructions, lookups, etc.
This improves performance of almost operations that in some way concatenate validities. It includes:
concat
,filter
,merge-sort
)