viirya commented on code in PR #7811:
URL: https://github.com/apache/datafusion-comet/pull/7811#discussion_r4805585224
##########
native/spark-expr/src/math_funcs/wide_decimal_binary_expr.rs:
##########
@@ -225,12 +311,24 @@ impl PhysicalExpr for WideDecimalBinaryExpr {
// optimization of the closure rather than the number of stores. #5309
// tracks removing the sentinel and `Cell` by writing null bits
directly.
let overflowed = Cell::new(false);
+ let check_overflow = |result: i256, raw: i256, report_scale| {
Review Comment:
This closure now runs the overflow check for every wide add, subtract and
multiply, including the default nonnegative-scale path. The comment above
`overflowed` notes that the closure's shape alone cost 3 to 5% on
overflow-bearing batches. Could you run `cargo bench --bench wide_decimal` in
`native/spark-expr` before and after 092eb7f and share the numbers? If the
non-overflow cases regress, marking `overflow` `#[cold]` or `#[inline(never)]`
would keep the error formatting out of the loop.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]