jorgecarleitao commented on a change in pull request #9235:
URL: https://github.com/apache/arrow/pull/9235#discussion_r559224860



##########
File path: rust/arrow/src/compute/kernels/arithmetic.rs
##########
@@ -147,16 +143,17 @@ where
         .values()
         .iter()
         .zip(right.values().iter())
-        .map(|(l, r)| op(*l, *r))
-        .collect::<Vec<T::Native>>();
+        .map(|(l, r)| op(*l, *r));
+    let mut buffer = MutableBuffer::new(0);
+    buffer.extend_from_exact_iter(values);

Review comment:
       This is the main difference in this PR for the arithmetics: extend from 
the iterator instead of extending a vector and then memcopying the data.




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

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


Reply via email to