kowanietz opened a new pull request, #10783:
URL: https://github.com/apache/arrow-rs/pull/10783

   # Which issue does this PR close?
   
   - part of #10245
   
   # Rationale for this change
   
   Replacing `BufferBuilder` with `Vec` improves the performenace of primitive 
array unary operations.
   
   # What changes are included in this PR?
   
   Replaces the `BufferBuilder<...>` usages in `PrimitiveArray::try_unary` and 
`PrimitiveArray::unary_opt` with `Vecs`. 
   
   Also adds benchmarks for both operations with and without input nulls
   
   # Are these changes tested?
   
   All tests pass:
   
   - `cargo fmt --all -- --check`
   - `cargo clippy -p arrow-array --all-targets --all-features --no-deps -- -D 
warnings`
   - `cargo test -p arrow-array --all-features`
   - `cargo bench -p arrow-array --bench primitive_array -- --test`
   
   Local benchmark results for 65,536 `Int32` values:
   
   | Benchmark | Before | After | Change |
   |---|---:|---:|---:|
   | `try_unary`, no input nulls | 10.600 µs | 8.865 µs | 16.4% faster |
   | `try_unary`, 20% input nulls | 54.486 µs | 54.623 µs | no clear change |
   | `unary_opt`, no input nulls | 48.641 µs | 49.630 µs | no clear change |
   | `unary_opt`, 20% input nulls | 75.155 µs | 75.903 µs | no clear change |
   
   I currently only have a MacBook available so benching this on Linux would 
probably make sense.
   
   # Are there any user-facing changes?
   
   No.
   


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