You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "andygrove (via GitHub)" <gi...@apache.org> on 2026/07/10 20:13:56 UTC
[PR] perf: optimize regexp_count in datafusion-functions [datafusion]
andygrove opened a new pull request, #23464:
URL: https://github.com/apache/datafusion/pull/23464
> 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
Added start==1 and ASCII fast paths in count_matches to skip the per-row chars().count()/char_indices() scans (wasted on the default 2-arg form, redundant for ASCII), leaving only the regex find_iter.
## What changes are included in this PR?
Added start==1 and ASCII fast paths in count_matches to skip the per-row chars().count()/char_indices() scans (wasted on the default 2-arg form, redundant for ASCII), leaving only the regex find_iter.
## Are these changes tested?
Correctness: unit tests + seeded differential fuzz (bit-identical Arrow output vs `main`).
Benchmark (criterion):
- regexp_count_no_start [size=1024, str_len=32]: -1.095% faster (base 40983ns -> cand 41432ns)
- regexp_count_no_start [size=1024, str_len=128]: 10.188% faster (base 68356ns -> cand 61392ns)
- regexp_count_with_start [size=1024, str_len=128]: -0.686% faster (base 66664ns -> cand 67121ns)
- regexp_count_with_start [size=1024, str_len=32]: 6.192% faster (base 42125ns -> cand 39516ns)
- regexp_count_with_start [size=4096, str_len=32]: 13.631% faster (base 179812ns -> cand 155302ns)
- regexp_count_with_start [size=4096, str_len=128]: 9.641% faster (base 303717ns -> cand 274437ns)
- regexp_count_no_start [size=4096, str_len=32]: 4.067% faster (base 166029ns -> cand 159276ns)
- regexp_count_no_start [size=4096, str_len=128]: 14.911% faster (base 307809ns -> cand 261912ns)
## Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
-->
<!--
If there are any breaking changes to public APIs, please add the `api change` label.
-->
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] perf: optimize regexp_count in datafusion-functions [datafusion]
Posted by "andygrove (via GitHub)" <gi...@apache.org>.
andygrove closed pull request #23464: perf: optimize regexp_count in datafusion-functions
URL: https://github.com/apache/datafusion/pull/23464
--
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: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org