Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-10274

[Rust] arithmetic without SIMD does unnecesary copy

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Invalid
    • None
    • None
    • Rust
    • None

    Description

      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?

       

       

          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![],
                  );

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            ritchie46 Ritchie
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: