jhorstmann commented on code in PR #6365:
URL: https://github.com/apache/arrow-rs/pull/6365#discussion_r1750341118


##########
arrow-arith/src/arity.rs:
##########
@@ -216,15 +220,39 @@ where
     }
 
     let nulls = NullBuffer::union(a.logical_nulls().as_ref(), 
b.logical_nulls().as_ref());
+    let mut output: Vec<MaybeUninit<O::Native>> = vec![MaybeUninit::uninit(); 
a.len()];
+    let a_chunks = a.values().as_ref().chunks_exact(CHUNK_SIZE);
+    let b_chunks = b.values().as_ref().chunks_exact(CHUNK_SIZE);
+    let output_chunks = output.as_mut_slice().chunks_exact(CHUNK_SIZE);
+
+    for (output, (a_chunk, b_chunk)) in 
output_chunks.zip(a_chunks.zip(b_chunks)) {
+        let a_values: [A::Native; CHUNK_SIZE] = a_chunk.try_into().unwrap();
+        let b_values: [B::Native; CHUNK_SIZE] = b_chunk.try_into().unwrap();
+        let mut output: [MaybeUninit<O::Native>; CHUNK_SIZE] = 
output.try_into().unwrap();

Review Comment:
   Hm, shouldn't this be of type `&mut [MaybeUnit<O::Native;> CHUNK_SIZE]`? 
Otherwise this would be writing to a temporary and the compiler would probably 
optimize it away.



-- 
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