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


##########
arrow-buffer/src/buffer/boolean.rs:
##########
@@ -519,17 +494,14 @@ impl BitAnd<&BooleanBuffer> for &BooleanBuffer {
 
     fn bitand(self, rhs: &BooleanBuffer) -> Self::Output {
         assert_eq!(self.bit_len, rhs.bit_len);
-        BooleanBuffer {
-            buffer: buffer_bin_and(
-                &self.buffer,
-                self.bit_offset,
-                &rhs.buffer,
-                rhs.bit_offset,
-                self.bit_len,
-            ),
-            bit_offset: 0,
-            bit_len: self.bit_len,
-        }
+        BooleanBuffer::from_bitwise_binary_op(

Review Comment:
   I think the results for `and` might be noisy just like the results before 
for `not` were noisy - it sometimes hits the aligned case and sometimes not 
(due to if buffer is allocated aligned or not).
   
   (See example of the same perf a run earlier:)
   
   ```
   and              1.01    209.9±3.67ns        ? ?/sec    1.00    208.4±0.58ns 
       ? ?/sec
   ```
   
   Also, the implemantation for `buffer_bin_and` is currently as follows 
(showing the difference should indeed be due to noise):
   
   
   ```
   BooleanBuffer::from_bitwise_binary_op(
           left,
           left_offset_in_bits,
           right,
           right_offset_in_bits,
           len_in_bits,
           |a, b| a & b,
       )
       .into_inner()
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to