Remove redundant benchmarks in cast_kernels#9789
Conversation
55fa12a to
580a1e1
Compare
cast_kernels
|
run benchmark cast_kernels |
|
🤖 Arrow criterion benchmark running (GKE) | trigger CPU Details (lscpu)Comparing alamb/prune-cast-benchmarks (580a1e1) to 9a2b49c (merge-base) diff File an issue against this benchmark runner |
scovich
left a comment
There was a problem hiding this comment.
LGTM, always nice to see a PR that reduces code size 🎉
|
🤖 Arrow criterion benchmark completed (GKE) | trigger Instance: CPU Details (lscpu)Details
Resource Usagebase (merge-base)
branch
File an issue against this benchmark runner |
klion26
left a comment
There was a problem hiding this comment.
Thanks for cleanup the code, LGTM
maybe we can keep a case(like decimal to int8)to cover the "overflow" path
Done in c601b35 |
# Which issue does this PR close? - Follow on to apache#9729 # Rationale for this change apache#9729, added many new cases to `cast_kernels` but many of these are redundant and increase the benchmark runtime without providing proportional value in coverage. This PR reduces the redundancy by: 1. Keeps one representative benchmark for each major physical code path (e.g., `i128` vs `i256` storage). 2. Removes redundant combinations of target types (e.g., casting `decimal128` to every integer width when `int64` is sufficient). 3. Consolidating invalid/error path testing into a single representative case. 4. Reducing the total number of benchmark cases from over 60 new additions to 10 high-value cases. # What changes are included in this PR? - Pruned redundant decimal-to-integer/float and string/float-to-decimal benchmarks in `arrow/benches/cast_kernels.rs`. - Added `create_primitive_array_range` helper to `arrow/src/util/bench_util.rs` Compared to main before PR apache#9729, the following benchmarks will be new after my PR apache#9789 is merged: 1. New Decimal Casting Benchmarks These cases cover the core performance paths for casting to and from decimals using representative physical storage types (i128 and i256): * cast string to decimal128(38, 3) * cast float64 to decimal128(32, 3) * cast invalid float64 to to decimal128(32, 3) (Error path testing) * cast decimal128 to float64 * cast decimal128 to int64 * cast decimal256 to float64 * cast decimal256 to int64 * cast decimal128 to decimal128 512 with lower scale (infallible) (specifically testing the fast path for infallible # Are these changes tested? CI covers verification. # Are there any user-facing changes? No.
Which issue does this PR close?
Rationale for this change
#9729, added many new cases to
cast_kernelsbut many of these are redundant and increase the benchmark runtime without providing proportional value in coverage.This PR reduces the redundancy by:
i128vsi256storage).decimal128to every integer width whenint64is sufficient).What changes are included in this PR?
arrow/benches/cast_kernels.rs.create_primitive_array_rangehelper toarrow/src/util/bench_util.rsCompared to main before PR #9729, the following benchmarks will be new after my PR #9789 is merged:
These cases cover the core performance paths for casting to and from decimals using representative physical storage types (i128 and i256):
Are these changes tested?
CI covers verification.
Are there any user-facing changes?
No.