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
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Performance
Milestone

Comments

@sylvinus
Copy link
Contributor

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

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
@andybons andybons added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Performance
Projects
None yet
Development

No branches or pull requests

4 participants