mbutrovich opened a new pull request, #11526:
URL: https://github.com/apache/arrow-rs/pull/11526

   # Which issue does this PR close?
   
   - Closes #11453.
   - Part of #11421.
   
   # Rationale for this change
   
   See #11453.
   
   # What changes are included in this PR?
   
   `divide_and_round` takes the divisor and returns a closure that computes 
`half` and `half_neg` once and divides each row with `i256::wrapping_div_rem` 
from #11425. `multiply_fixed_point` and `multiply_fixed_point_checked` build 
the closure before calling `binary` and `try_binary`. The results don't change.
   
   # Are these changes tested?
   
   `test_decimal_multiply_fixed_point_rounding` in 
`arrow-arith/src/arithmetic.rs` covers rounding of negative products, ties and 
both null paths, which the existing tests of `multiply_fixed_point` and 
`multiply_fixed_point_checked` don't reach. It passes on `main` and with this 
change.
   
   On an Apple M5 Max with rustc 1.99.0, the `decimal128_multiply_fixed_point` 
benchmark from #11427 gave, in us per 1024 values:
   
   | Case | `main` | This PR |
   |---|---|---|
   | 15 digits, scale 10 to scale 6 | 43.6 | 19.1 |
   | 24 digits, scale 10 to scale 6 | 61.1 | 29.4 |
   | 21 digits, scale 20 to scale 6 | 53.0 | 23.5 |
   
   I'll run the benchmark bot on this PR for arm64 and x86_64 numbers.
   
   # Are there any significant user-facing changes?
   
   No.
   
   ## AI Disclosure
   
   I wrote this PR with help from Claude but understand and support the core 
approach, implementation, and test coverage.
   


-- 
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]

Reply via email to