GeezerVison is showing github.com — Speedup String#{ indexOf, lastIndexOf } by MaxGraey · Pull Request #2649 · AssemblyScript/assemblyscript
Conversation
MaxGraey
commented
Feb 13, 2023
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
This speedup indexOf matching, especially for long strings and single character.
Benchmark results:
Old
- SAMPLE22_0:ok: 69.700 ms
- SAMPLE22_0:eof: 49.000 ms
- SAMPLE63_1:ok: 90.700 ms
- SAMPLE63_1:eof: 87.200 ms
- SAMPLE1k_h:ok: 345.100 ms
- SAMPLE1k_h:eof: 723.800 ms
New
- SAMPLE22_0:ok: 40.600 ms (~1.7x)
- SAMPLE22_0:eof: 39.400 ms (~1.3x)
- SAMPLE63_1:ok: 64.900 ms (~1.4x)
- SAMPLE63_1:eof: 54.900 ms (~1.6x)
- SAMPLE1k_h:ok: 318.900 ms (~1.0x)
- SAMPLE1k_h:eof: 350.800 ms (~2.0x)
Benchmark Playground: https://tinyurl.com/pjftv9pp
- I've read the contributing guidelines
- I've added my name and email to the NOTICE file
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
MaxGraey
changed the title
Speedup String#{ indexOf, lastIndexOf } is needle is single character
Speedup String#{ indexOf, lastIndexOf }
Feb 19, 2023
This branch has not been deployed
No deployments
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.