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
Faster readRegexp #13453
Merged
Merged
Faster readRegexp #13453
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
baseline 256-size RegExp literal : 66124 ops/sec ±8.34% (0.015ms) baseline 512-size RegExp literal : 43351 ops/sec ±1.05% (0.023ms) baseline 1024-size RegExp literal : 24620 ops/sec ±0.34% (0.041ms) baseline 2048-size RegExp literal : 12957 ops/sec ±0.2% (0.077ms) current 256-size RegExp literal : 151662 ops/sec ±12.21% (0.007ms) current 512-size RegExp literal : 113828 ops/sec ±0.37% (0.009ms) current 1024-size RegExp literal : 67246 ops/sec ±1.95% (0.015ms) current 2048-size RegExp literal : 35645 ops/sec ±1.69% (0.028ms)
baseline 256-size RegExp literal : 142419 ops/sec ±14.37% (0.007ms) baseline 512-size RegExp literal : 110003 ops/sec ±0.95% (0.009ms) baseline 1024-size RegExp literal : 69509 ops/sec ±0.68% (0.014ms) baseline 2048-size RegExp literal : 36217 ops/sec ±4.63% (0.028ms) current 256-size RegExp literal : 166167 ops/sec ±1.04% (0.006ms) current 512-size RegExp literal : 120889 ops/sec ±1.25% (0.008ms) current 1024-size RegExp literal : 76181 ops/sec ±1.46% (0.013ms) current 2048-size RegExp literal : 44898 ops/sec ±1.25% (0.022ms)
baseline 256 small regexp literal with all flags: 4342 ops/sec ±1.57% (0.23ms) baseline 512 small regexp literal with all flags: 2213 ops/sec ±1.51% (0.452ms) baseline 1024 small regexp literal with all flags: 1144 ops/sec ±0.22% (0.874ms) baseline 2048 small regexp literal with all flags: 541 ops/sec ±1.12% (1.849ms) current 256 small regexp literal with all flags: 4643 ops/sec ±1.3% (0.215ms) current 512 small regexp literal with all flags: 2355 ops/sec ±1.14% (0.425ms) current 1024 small regexp literal with all flags: 1176 ops/sec ±0.87% (0.85ms) current 2048 small regexp literal with all flags: 553 ops/sec ±1.31% (1.807ms)
JLHwung
added
pkg: parser
PR: Performance 🏃♀️
A type of pull request used for our changelog categories
labels
Jun 10, 2021
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/46811/ |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit f377065:
|
nicolo-ribaudo
approved these changes
Jun 10, 2021
existentialism
approved these changes
Jun 10, 2021
jridgewell
approved these changes
Jun 10, 2021
github-actions
bot
added
the
outdated
A closed issue/PR that is archived due to age. Recommended to make a new issue
label
Sep 10, 2021
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
outdated
A closed issue/PR that is archived due to age. Recommended to make a new issue
pkg: parser
PR: Performance 🏃♀️
A type of pull request used for our changelog categories
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.
Fixes #1, Fixes #2
Scanning Regexp is now 200% faster for large regexp, 15% faster for a small regexp with all available flags.
The following improvements are implemented:
charAt
tocharCodeAt
pos
to parser state until we have toFor benchmark results, please check commit messages below.