chore: add cast_decimal benchmark#6850
Conversation
alamb
left a comment
There was a problem hiding this comment.
Thanks @andygrove -- I left some comments -- let me know what you think
arrow-cast/benches/cast_decimal.rs
Outdated
|
|
||
| fn criterion_benchmark(c: &mut Criterion) { | ||
| let decimals: ArrayRef = Arc::new( | ||
| Decimal128Array::from(vec![ |
There was a problem hiding this comment.
I recommend creating a slightly larger array that mirrors actual workloads (e.g. 4k or 8k values, maybe just repeating these values multiple times).
Using a small array like may amplify the overheads of function invocation compared to the actual work being done
arrow-cast/benches/cast_decimal.rs
Outdated
| // specific language governing permissions and limitations | ||
| // under the License. | ||
|
|
||
| use arrow_array::{ArrayRef, Decimal128Array}; |
There was a problem hiding this comment.
I think we should put this along side the other benchmarks for cast in https://github.com/apache/arrow-rs/blob/main/arrow/benches/cast_kernels.rs#L1-L0
There was a problem hiding this comment.
and it turns out that we already have tests for this that I can easily modify 🙄
c.bench_function("cast decimal128 to decimal128 512", |b| {
b.iter(|| cast_array(&decimal128_array, DataType::Decimal128(30, 5)))
});
Which issue does this PR close?
Part of #6833
Rationale for this change
We need a benchmark to help review #6836
What changes are included in this PR?
Are there any user-facing changes?