andygrove opened a new pull request, #4924:
URL: https://github.com/apache/datafusion-comet/pull/4924
> This PR was created by an LLM as a draft PR. I will mark it as ready for
review after human review.
## Which issue does this PR close?
N/A — autonomous exploratory PR.
## Rationale for this change
Replaced the per-row u128 to_string heap allocation, format! machinery, and
"0".repeat in the LEGACY Decimal128-to-string cast with an allocation-free
stack digit buffer that renders the coefficient in 19-digit 64-bit chunks and
appends slices directly to the reused output buffer.
## What changes are included in this PR?
Replaced the per-row u128 to_string heap allocation, format! machinery, and
"0".repeat in the LEGACY Decimal128-to-string cast with an allocation-free
stack digit buffer that renders the coefficient in 19-digit 64-bit chunks and
appends slices directly to the reused output buffer.
## How are these changes tested?
Correctness: unit tests + seeded differential fuzz (bit-identical Arrow
output vs `main`).
Benchmark (criterion):
- decimal128_leading_zeroes: 73.764% faster (base 197033ns -> cand 51693ns)
- decimal128_wide: 20.876% faster (base 198585ns -> cand 157128ns)
- decimal128_scientific: 49.361% faster (base 172590ns -> cand 87397ns)
- decimal128_scale_2: 52.624% faster (base 155170ns -> cand 73513ns)
Full criterion output:
```text
cast_decimal_to_string/decimal128_scale_2
time: [73.783 µs 73.913 µs 74.059 µs]
change: [−52.799% −52.624% −52.452%] (p = 0.00 <
0.05)
Performance has improved.
Found 1 outliers among 100 measurements (1.00%)
1 (1.00%) high mild
cast_decimal_to_string/decimal128_leading_zeroes
time: [51.381 µs 51.495 µs 51.615 µs]
change: [−73.817% −73.764% −73.700%] (p = 0.00 <
0.05)
Performance has improved.
Found 22 outliers among 100 measurements (22.00%)
16 (16.00%) low severe
1 (1.00%) low mild
3 (3.00%) high mild
2 (2.00%) high severe
cast_decimal_to_string/decimal128_wide
time: [157.06 µs 157.33 µs 157.66 µs]
change: [−20.987% −20.876% −20.752%] (p = 0.00 <
0.05)
Performance has improved.
Found 4 outliers among 100 measurements (4.00%)
1 (1.00%) high mild
3 (3.00%) high severe
cast_decimal_to_string/decimal128_scientific
time: [87.563 µs 87.699 µs 87.832 µs]
change: [−49.456% −49.361% −49.272%] (p = 0.00 <
0.05)
Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
1 (1.00%) low severe
1 (1.00%) high mild
```
--
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]