perf: optimize spark_floor (up to 4x faster)#4911
Conversation
spark_floor (up to 4x faster)
…datafusion-comet-20260713-114953 # Conflicts: # native/spark-expr/Cargo.toml
|
Both this and #4926 edit the shared Suggested change: land one mechanism and apply it to both. The |
Adopts impl Fn on both helpers so they are symmetric and no callsite needs to pass &f, addressing coordination feedback with apache#4926 which uses impl Fn too. Floor's scalar path drops its stray &f.
|
Coordinated with #4926 per your feedback: this PR keeps |
Which issue does this PR close?
N/A
Rationale for this change
Optimize an existing expression.
What changes are included in this PR?
Decimal floor now monomorphizes the per-element op (was &dyn Fn) and dispatches on input scale to a const divisor with an i64 fast path, so the per-row 128-bit __divti3 division libcall becomes a multiply-and-shift.
How are these changes tested?
Existing tests.
Benchmark (criterion):
Full criterion output: