ritchie46 commented on pull request #9860:
URL: https://github.com/apache/arrow/pull/9860#issuecomment-810995348
> @ritchie46 did you have some perf results on this?
> I think it definitely makes sense, especially as the functions are wrapped
in (unnecessary) `Result` now which might make things worse. Sometimes inlining
makes things worse performance wise, that's why I think we should have some
numbers.
There are quite some functions, but for met the most important one is the
primitive builder.
Running this benchmark:
```rust
fn create_primitive_array(n: usize) -> PrimitiveArray<Int64Type> {
let mut builder = PrimitiveBuilder::new(n);
for i in 0..n {
builder.append_value(i as i64).unwrap();
}
builder.finish()
}
fn add_benchmark(c: &mut Criterion) {
c.bench_function("512", |b| b.iter(|| create_primitive_array(512)));
c.bench_function("4096", |b| b.iter(|| create_primitive_array(4096)));
}
```
Gave the following improvement:
```
Gnuplot not found, using plotters backend
512 time: [848.60 ns 848.70 ns 848.81 ns]
change: [-54.476% -54.424% -54.383%] (p = 0.00 <
0.05)
Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
2 (2.00%) low mild
1 (1.00%) high mild
3 (3.00%) high severe
4096 time: [5.3370 us 5.3449 us 5.3539 us]
change: [-62.787% -62.696% -62.617%] (p = 0.00 <
0.05)
Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) high mild
1 (1.00%) high severe
```
--
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]