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

   # Which issue does this PR close?
   
   - N/A
   
   # Rationale for this change
   
   When `regexp_match` is used with a scalar pattern, we previously allocated a 
new `CaptureLocations` value for every row that was matched against. We can do 
better by allocating the storage once and then reusing it for every row via the 
`Regex::captures_read()` API.
   
   Benchmarks: (M4 Max)
   
   - Utf8, matching: 1,463.97 → 1,070.79 µs — 26.9% less time.
   - Utf8, mixed: 829.28 → 607.46 µs — 26.7% less time.
   - Utf8, no matches: 299.01 → 148.47 µs — 50.3% less time.
   - Utf8View, matching: 1,496.74 → 1,159.14 µs — 22.6% less time.
   - Utf8View, mixed: 849.78 → 649.64 µs — 23.6% less time.
   - Utf8View, no matches: 253.79 → 151.30 µs — 40.4% less time.
   
   # What changes are included in this PR?
   
   * Switch to `Regex::captures_read` in `regexp_scalar_match` and 
`regexp_scalar_match_utf8view`
   * Add benchmark
   * Improve test coverage of scalar regexp matching
   
   # Are these changes tested?
   
   Yes. New tests added to increase test coverage of this function overall.
   
   # Are there any user-facing changes?
   
   No.
   


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