-
-
Notifications
You must be signed in to change notification settings - Fork 406
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
[Merged by Bors] - Fast path for static property keys #2604
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2604 +/- ##
==========================================
+ Coverage 49.17% 49.28% +0.10%
==========================================
Files 386 385 -1
Lines 38843 38989 +146
==========================================
+ Hits 19102 19214 +112
- Misses 19741 19775 +34
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice optimization!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 😄
bors r+ |
When a rust string literal is given for a property key, boa checks if it can be parsed as an index and converts the string into a utf16 slice. This PR rewrites each hard-coded property key as a utf16 slice so that we can bypass those conversions at runtime. This improves QuickJS benchmark score 5% on average. Richards: 35.4 -> 37.0 DeltaBlue: 35.0 -> 38.1 Crypto: 57.6 -> 59.6 RayTrace: 137 -> 146 EarleyBoyer: 131 -> 138 Splay: 98.3 -> 104 NavierStokes: 10.2 -> 10.2
Pull request successfully merged into main. Build succeeded: |
Similar to #2604, `GetPropertyByName`/`SetPropertyByName` has only string property key. So, we can skip index and utf16 conversions. This improves QuickJS benchmark score 5.8% on average. Richards: 37.0 -> 41.2 DeltaBlue: 38.1 -> 41.4 Crypto: 59.6 -> 59.8 RayTrace: 146 -> 159 EarleyBoyer: 138 -> 142 Splay: 104 -> 106 NavierStokes: 10.2 -> 10.3
Similar to #2604, `GetPropertyByName`/`SetPropertyByName` has only string property key. So, we can skip index and utf16 conversions. This improves QuickJS benchmark score 5.8% on average. Richards: 37.0 -> 41.2 DeltaBlue: 38.1 -> 41.4 Crypto: 59.6 -> 59.8 RayTrace: 146 -> 159 EarleyBoyer: 138 -> 142 Splay: 104 -> 106 NavierStokes: 10.2 -> 10.3
When a rust string literal is given for a property key, boa checks if it can be parsed as an index and converts the string into a utf16 slice. This PR rewrites each hard-coded property key as a utf16 slice so that we can bypass those conversions at runtime.
This improves QuickJS benchmark score 5% on average.
Richards: 35.4 -> 37.0
DeltaBlue: 35.0 -> 38.1
Crypto: 57.6 -> 59.6
RayTrace: 137 -> 146
EarleyBoyer: 131 -> 138
Splay: 98.3 -> 104
NavierStokes: 10.2 -> 10.2