andygrove opened a new pull request, #4912:
URL: https://github.com/apache/datafusion-comet/pull/4912
> 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 per-row (and, for hex styles, per-byte) String allocation with a
single pre-sized GenericStringBuilder plus a reusable scratch buffer and
table-driven hex/i8 formatting, and made the default no-style path reuse the
binary array's buffers zero-copy instead of copying every value.
## What changes are included in this PR?
Replaced per-row (and, for hex styles, per-byte) String allocation with a
single pre-sized GenericStringBuilder plus a reusable scratch buffer and
table-driven hex/i8 formatting, and made the default no-style path reuse the
binary array's buffers zero-copy instead of copying every value.
## How are these changes tested?
Correctness: unit tests + seeded differential fuzz (bit-identical Arrow
output vs `main`).
Benchmark (criterion):
- cast_binary_to_string_ hex discrete, short values: 95.866% faster (base
2122729ns -> cand 87755ns)
- cast_binary_to_string_ default style, long values: 99.986% faster (base
348283ns -> cand 47ns)
- cast_binary_to_string_ base64, long values: 12.938% faster (base 339431ns
-> cand 295516ns)
- cast_binary_to_string_ hex discrete, with nulls: 93.681% faster (base
3003499ns -> cand 189798ns)
- cast_binary_to_string_ hex, long values: 95.941% faster (base 10712752ns
-> cand 434829ns)
- cast_binary_to_string_ hex discrete, long values: 92.166% faster (base
9132107ns -> cand 715412ns)
- cast_binary_to_string_ basic, long values: 61.485% faster (base 9169843ns
-> cand 3531765ns)
Full criterion output:
```text
cast_binary_to_string: hex discrete, short values
time: [87.333 µs 87.713 µs 88.170 µs]
change: [−95.882% −95.866% −95.849%] (p = 0.00 <
0.05)
Performance has improved.
Found 16 outliers among 100 measurements (16.00%)
16 (16.00%) high severe
cast_binary_to_string: hex discrete, long values
time: [714.83 µs 715.24 µs 715.64 µs]
change: [−92.176% −92.166% −92.157%] (p = 0.00 <
0.05)
Performance has improved.
Found 14 outliers among 100 measurements (14.00%)
4 (4.00%) low severe
3 (3.00%) low mild
5 (5.00%) high mild
2 (2.00%) high severe
cast_binary_to_string: hex discrete, with nulls
time: [189.76 µs 189.88 µs 190.00 µs]
change: [−93.698% −93.681% −93.665%] (p = 0.00 <
0.05)
Performance has improved.
Found 10 outliers among 100 measurements (10.00%)
3 (3.00%) low mild
5 (5.00%) high mild
2 (2.00%) high severe
cast_binary_to_string: hex, long values
time: [434.68 µs 434.89 µs 435.14 µs]
change: [−95.948% −95.941% −95.935%] (p = 0.00 <
0.05)
Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
1 (1.00%) low mild
1 (1.00%) high mild
1 (1.00%) high severe
cast_binary_to_string: basic, long values
time: [3.5281 ms 3.5318 ms 3.5357 ms]
change: [−61.553% −61.485% −61.425%] (p = 0.00 <
0.05)
Performance has improved.
Found 4 outliers among 100 measurements (4.00%)
1 (1.00%) low severe
1 (1.00%) low mild
1 (1.00%) high mild
1 (1.00%) high severe
cast_binary_to_string: base64, long values
time: [295.09 µs 295.41 µs 295.73 µs]
change: [−13.141% −12.938% −12.732%] (p = 0.00 <
0.05)
Performance has improved.
Found 3 outliers among 100 measurements (3.00%)
1 (1.00%) low mild
2 (2.00%) high severe
cast_binary_to_string: default style, long values
time: [47.321 ns 47.343 ns 47.370 ns]
change: [−99.986% −99.986% −99.986%] (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
```
--
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]