Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization of the main DFA loop: avoid unnecessary in-loop runtime checks for matching DFA states #455

Closed
wants to merge 1 commit into from

Conversation

vovkos
Copy link
Contributor

@vovkos vovkos commented Oct 30, 2023

  1. Avoid adjusting lastmatch in-loop. Instead, adjust it once before returning from the InlinedSearchLoop<> 2) Avoid run-time checks before saving match IDs in matches; instead, create additional template specializations for InlinedSearchLoop<> and only do that when necessary. RE2::Set is a very special use-case of re2 (and let's be honest, a rarely used one). Yet, those in-loop runtime checks impose a performance penalty on all other use-cases.

…op runtime checks for matching DFA states

1) Avoid adjusting `lastmatch` in-loop. Instead, adjust it once before returning from the `InlinedSearchLoop<>`
2) Avoid run-time checks before saving `match_id`-s; instead, create additional template specializations for `InlinedSearchLoop<>` and only do that when necessary. RE2::Set is a very special use-case of re2 (and let's be honest, a rarely used one). Yet, those in-loop runtime checks impose a performance penalty on all other use-cases.
@google-cla
Copy link

google-cla bot commented Oct 30, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions
Copy link

RE2 uses Gerrit instead of GitHub pull requests.
See the Contribute wiki page.

@github-actions github-actions bot closed this Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant