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

regexp: optimize for provably too long inputs #33484

Open
sylvinus opened this issue Aug 5, 2019 · 1 comment
Open

regexp: optimize for provably too long inputs #33484

sylvinus opened this issue Aug 5, 2019 · 1 comment

Comments

@sylvinus
Copy link
Contributor

@sylvinus sylvinus commented Aug 5, 2019

As a complement to #31329, we should find out what the maximum length of matchable inputs is at compile-time (when it exists) and return very early.

Some patterns for which this can be computed:

  • ^a{2,5}$ (max length 5)
  • ^((aaa)|(aa))$ (max length 3)
  • ^.$ (max length utf8.UTFMax=4)
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Aug 6, 2019

Change https://golang.org/cl/188800 mentions this issue: regexp: optimize for provably too long inputs

@ALTree ALTree added this to the Unplanned milestone Aug 6, 2019
@ALTree ALTree added the Performance label Aug 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.