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
cmdline-opts/gen.pl: fix option matching to improve references #8299
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Previously it could mistakenly match partial names when there are options that start with the same prefix, leading to the wrong references used.
I ran into this bug with #8300 |
emilengler
added a commit
to emilengler/curl
that referenced
this pull request
Jul 30, 2022
On some systems, the gen.pl script takes nearly two minutes for the generation of the main-page, which is a completely unacceptable time. The commit author thinks, that the terrible performance comes from some low-level locale checks regarding the use of "\W" in a regular expression. This commit replaces the "\W" with [^a-zA-Z0-9_], which is, according to regex101.com, functionally equivalent to the previous operation, except that it is obviously limited to ASCII, which is fine, as the curl project is English-only anyway. See curl#8299 Fixes curl#9230 Closes #XXXX
emilengler
added a commit
to emilengler/curl
that referenced
this pull request
Jul 30, 2022
On some systems, the gen.pl script takes nearly two minutes for the generation of the main-page, which is a completely unacceptable time. The commit author thinks, that the terrible performance comes from some low-level locale checks regarding the use of "\W" in a regular expression. This commit replaces the "\W" with [^a-zA-Z0-9_], which is, according to regex101.com, functionally equivalent to the previous operation, except that it is obviously limited to ASCII, which is fine, as the curl project is English-only anyway. See curl#8299 Fixes curl#9230 Closes curl#9232
emilengler
added a commit
to emilengler/curl
that referenced
this pull request
Jul 31, 2022
On some systems, the gen.pl script takes nearly two minutes for the generation of the main-page, which is a completely unacceptable time. The commit author thinks, that the terrible performance comes from some low-level locale checks regarding the use of "\W" in a regular expression. This commit replaces the "\W" with [^a-zA-Z0-9_], which is, according to regex101.com, functionally equivalent to the previous operation, except that it is obviously limited to ASCII, which is fine, as the curl project is English-only anyway. Co-authored-by: Emanuele Torre <torreemanuele6@gmail.com> See curl#8299 Fixes curl#9230 Closes curl#9232
emilengler
added a commit
to emilengler/curl
that referenced
this pull request
Aug 1, 2022
On some systems, the gen.pl script takes nearly two minutes for the generation of the main-page, which is a completely unacceptable time. The slow performance has two causes: 1. Use of a regex locale operator 2. Useless invokations of loops The commit addresses the first issue by replacing the "\W" wiht [^a-zA-Z0-9_], which is, according to regex101.com, functionally equivalent to the previous operation, except that it is obviously limited to ASCII only, which is fine, as the curl project is English-only anyway. The second issue is being addressed by only running the loop if the line contains a "--" in it. The loop may be completeley removed in the future. Co-authored-by: Emanuele Torre <torreemanuele6@gmail.com> See curl#8299 Fixes curl#9230 Closes curl#9232
bagder
pushed a commit
that referenced
this pull request
Aug 2, 2022
On some systems, the gen.pl script takes nearly two minutes for the generation of the main-page, which is a completely unacceptable time. The slow performance has two causes: 1. Use of a regex locale operator 2. Useless invokations of loops The commit addresses the first issue by replacing the "\W" wiht [^a-zA-Z0-9_], which is, according to regex101.com, functionally equivalent to the previous operation, except that it is obviously limited to ASCII only, which is fine, as the curl project is English-only anyway. The second issue is being addressed by only running the loop if the line contains a "--" in it. The loop may be completeley removed in the future. Co-authored-by: Emanuele Torre <torreemanuele6@gmail.com> See #8299 Fixes #9230 Closes #9232
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously it could mistakenly match partial names when there are
options that start with the same prefix, leading to the wrong references
used.