Ritchie created ARROW-10274:
-------------------------------

             Summary: [Rust] arithmetic without SIMD does unnecesary copy
                 Key: ARROW-10274
                 URL: https://issues.apache.org/jira/browse/ARROW-10274
             Project: Apache Arrow
          Issue Type: Improvement
            Reporter: Ritchie


The arithmetic kernels that don't use SIMD create a `vec` in memory and later 
copy that data into a Buffer. Maybe we could directly write the arithmetic 
result to a mutable buffer and prevent this redundant copy?

 

 
{code:java}
    let values = (0..left.len())
                .map(|i| op(left.value(i), right.value(i))) 
                .collect::<Vec<T::Native>>();
     
      
            let data = ArrayData::new(
          T::get_data_type(),
                left.len(),
                None,
                null_bit_buffer,
                0,
                vec![Buffer::from(values.to_byte_slice())],
                vec![],
            );{code}
 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to