andygrove opened a new pull request, #4903:
URL: https://github.com/apache/datafusion-comet/pull/4903
> 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 Arrow's substring_by_char with an implementation that skips the
per-element chars().count() (unused for non-negative starts) and adds a bulk
ASCII fast path that slices windows by byte offset without decoding UTF-8.
## What changes are included in this PR?
Replaced Arrow's substring_by_char with an implementation that skips the
per-element chars().count() (unused for non-negative starts) and adds a bulk
ASCII fast path that slices windows by byte offset without decoding UTF-8.
## How are these changes tested?
Correctness: unit tests + seeded differential fuzz (bit-identical Arrow
output vs `main`).
Benchmark (criterion):
- substring_ long ascii tail: 90.315% faster (base 1049866ns -> cand
101681ns)
- substring_ long ascii prefix: 45.268% faster (base 161701ns -> cand
88502ns)
- substring_ short ascii: 69.169% faster (base 89039ns -> cand 27451ns)
- substring_ long utf8 tail: 34.768% faster (base 3226354ns -> cand
2104613ns)
- substring_ long utf8 prefix: 63.96% faster (base 365291ns -> cand 131650ns)
Full criterion output:
```text
substring: short ascii time: [27.371 µs 27.413 µs 27.457 µs]
change: [−69.325% −69.169% −69.016%] (p = 0.00 <
0.05)
Performance has improved.
Found 10 outliers among 100 measurements (10.00%)
6 (6.00%) low mild
2 (2.00%) high mild
2 (2.00%) high severe
substring: long ascii prefix
time: [88.107 µs 88.511 µs 88.914 µs]
change: [−45.520% −45.268% −45.006%] (p = 0.00 <
0.05)
Performance has improved.
substring: long ascii tail
time: [101.42 µs 101.97 µs 102.50 µs]
change: [−90.371% −90.315% −90.260%] (p = 0.00 <
0.05)
Performance has improved.
substring: long utf8 prefix
time: [131.49 µs 131.61 µs 131.77 µs]
change: [−64.048% −63.960% −63.868%] (p = 0.00 <
0.05)
Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
3 (3.00%) high mild
6 (6.00%) high severe
substring: long utf8 tail
time: [2.1015 ms 2.1046 ms 2.1087 ms]
change: [−34.887% −34.768% −34.620%] (p = 0.00 <
0.05)
Performance has improved.
Found 13 outliers among 100 measurements (13.00%)
1 (1.00%) low mild
3 (3.00%) high mild
9 (9.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]