mbutrovich opened a new issue, #12174: URL: https://github.com/apache/arrow-rs/issues/12174
### Is your feature request related to a problem or challenge? Part of #11421. [`Display for i256`](https://github.com/apache/arrow-rs/blob/6b34163d51aa59f7cac2edcb74e8bd1ddc6b9120/arrow-buffer/src/bigint/mod.rs#L83-L84) splits a value that does not fit in `i128` into up to three 38-digit chunks by dividing by 10^38 twice per value with the generic digit-array `div_rem`. The divisor is a constant, so a reciprocal can be computed at compile time or once. ### Describe the solution you'd like Use the `i256` divisor from {{01}} (or a `u256` form of it) for the two divisions, and skip the second one when the first quotient is below 10^38. The `format_decimal` benchmark in `arrow-cast` has `Decimal256` cases with 38 and 76 digits. Confirm they reach `Display for i256`, and add a case with values between 39 and 76 digits if they don't, in a commit before the change. The PR reports the bot's before and after numbers. The result must stay identical to today's output for every input, including `i256::MIN`, whose magnitude does not fit in a signed `i256`. ### Describe alternatives you've considered Values that fit in `i128` already take the `to_i128` fast path, and #11530 makes `i256::div_rem` of magnitudes below 2^128 one `u128` division. The benchmark should show how much is left for wider values before this is worth doing. ### Additional context None. -- 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]
