Skip to content

Commit

Permalink
Add benchmark for infallible casting to smaller scale.
Browse files Browse the repository at this point in the history
  • Loading branch information
aweltsch committed Jan 25, 2025
1 parent 30d3fc3 commit 69a665b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arrow/benches/cast_kernels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,11 @@ fn add_benchmark(c: &mut Criterion) {
c.bench_function("cast decimal128 to decimal128 512 with same scale", |b| {
b.iter(|| cast_array(&decimal128_array, DataType::Decimal128(30, 3)))
});

c.bench_function("cast decimal128 to decimal128 512 with lower scale (infallible)", |b| {
b.iter(|| cast_array(&decimal128_array, DataType::Decimal128(7, -1)))
});

c.bench_function("cast decimal256 to decimal256 512 with same scale", |b| {
b.iter(|| cast_array(&decimal256_array, DataType::Decimal256(60, 3)))
});
Expand Down

0 comments on commit 69a665b

Please sign in to comment.