-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
refactor(tools/string): speed up strip (whitespace) #13168
Merged
Merged
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
github-actions
bot
added
the
cherry-pick kong-ee
schedule this PR for cherry-picking to kong/kong-ee
label
Jun 5, 2024
bungle
force-pushed
the
refactor/speed-up-strip
branch
from
June 5, 2024 20:43
9d38b31
to
8b481d3
Compare
chronolaw
reviewed
Jun 5, 2024
git-hulk
reviewed
Jun 6, 2024
bungle
force-pushed
the
refactor/speed-up-strip
branch
3 times, most recently
from
June 6, 2024 06:57
c734467
to
4450845
Compare
chronolaw
approved these changes
Jun 7, 2024
### Summary With simple microbenchmark: ```lua ngx.update_time() local s = ngx.now() for i = 1, 100000 do local a = strip(" \t \ndogestr \f\t\r ") end ngx.update_time() local e = ngx.now() print("took: ", (e * 1000) - (s * 1000), " ms") ``` I get these results: Current: `took: 57 ms` PR: `took: 7 ms` Signed-off-by: Aapo Talvensaari <[email protected]>
bungle
force-pushed
the
refactor/speed-up-strip
branch
from
June 7, 2024 12:30
b5bdfbb
to
eba6e98
Compare
jschmid1
approved these changes
Jun 12, 2024
Successfully created cherry-pick PR for |
locao
pushed a commit
that referenced
this pull request
Jun 21, 2024
### Summary With simple microbenchmark: ```lua ngx.update_time() local s = ngx.now() for i = 1, 100000 do local a = strip(" \t \ndogestr \f\t\r ") end ngx.update_time() local e = ngx.now() print("took: ", (e * 1000) - (s * 1000), " ms") ``` I get these results: Current: `took: 57 ms` PR: `took: 7 ms` Signed-off-by: Aapo Talvensaari <[email protected]> (cherry picked from commit 582d5ac)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Summary
With simple microbenchmark:
I get these results:
Current:
took: 57 ms
PR:
took: 7 ms
KAG-4684