You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/09/04 11:17:14 UTC

[GitHub] [arrow-rs] Dandandan commented on a diff in pull request #2646: Help LLVM vectorize comparison kernel ~50-70% faster

Dandandan commented on code in PR #2646:
URL: https://github.com/apache/arrow-rs/pull/2646#discussion_r962295632


##########
arrow/src/compute/kernels/comparison.rs:
##########
@@ -59,12 +59,30 @@ where
     let null_bit_buffer =
         combine_option_bitmap(&[left.data_ref(), right.data_ref()], left.len())?;
 
-    // Safety:
-    // `i < $left.len()` and $left.len() == $right.len()
-    let comparison = (0..left.len())
-        .map(|i| unsafe { op(left.value_unchecked(i), right.value_unchecked(i)) });
-    // same size as $left.len() and $right.len()
-    let buffer = unsafe { MutableBuffer::from_trusted_len_iter_bool(comparison) };
+    let mut buffer = MutableBuffer::new((left.len() + 7) / 8);
+
+    let chunks = left.len() / 8;

Review Comment:
    Can't we change the implementation of `from_trusted_len_iter_bool` instead?



-- 
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-unsubscribe@arrow.apache.org

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