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 2021/04/26 12:37:23 UTC

[GitHub] [arrow-rs] alamb opened a new issue #110: arithmetic without SIMD does unnecesary copy

alamb opened a new issue #110:
URL: https://github.com/apache/arrow-rs/issues/110


   *Note*: migrated from original JIRA: https://issues.apache.org/jira/browse/ARROW-10274
   
   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 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:
users@infra.apache.org



[GitHub] [arrow-rs] alamb commented on issue #110: arithmetic without SIMD does unnecesary copy

Posted by GitBox <gi...@apache.org>.
alamb commented on issue #110:
URL: https://github.com/apache/arrow-rs/issues/110#issuecomment-826800621


   Comment from Jorge Leitão(jorgecarleitao) @ 2020-10-11T08:50:04.358+0000:
   <pre>> Maybe we could directly write the arithmetic result to a mutable buffer and prevent this redundant copy?
   
   Yes :)</pre>


-- 
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:
users@infra.apache.org