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

Optimize take_bits to optimize take_boolean / take_primitive / take_byte_view: up to -25% #6622

Merged
merged 17 commits into from
Oct 24, 2024
Prev Previous commit
Next Next commit
Style
Dandandan committed Oct 24, 2024
commit 74a276de360cf416f9ef21bcdccb73122cae5118
4 changes: 2 additions & 2 deletions arrow-select/src/take.rs
Original file line number Diff line number Diff line change
@@ -428,13 +428,13 @@ fn take_bits<I: ArrowPrimitiveType>(
match indices.nulls().filter(|n| n.null_count() > 0) {
Some(nulls) => {
let mut output_buffer = MutableBuffer::new_null(len);
let output_slice: &mut [u8] = output_buffer.as_slice_mut();
let output_slice = output_buffer.as_slice_mut();
nulls.valid_indices().for_each(|idx| {
if values.value(indices.value(idx).as_usize()) {
bit_util::set_bit(output_slice, idx);
}
});
BooleanBuffer::new(output_buffer.into(), 0, indices.len())
BooleanBuffer::new(output_buffer.into(), 0, len)
}
None => {
BooleanBuffer::collect_bool(len, |idx: usize| {