-
-
Notifications
You must be signed in to change notification settings - Fork 34.6k
src: optimize utf-8 byte length calculation using simdutf #61601
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
base: main
Are you sure you want to change the base?
Conversation
BridgeAR
left a comment
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.
The benchmarks show mostly regressions, no?
I only changed the UTF-8 calculation for Buffer.byteLength(). The regression results you see may be due to the local environment. Could you run benchmark-ci for me? That way we can be more certain. |
a92f8f1 to
97a81a8
Compare
97a81a8 to
c63b474
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #61601 +/- ##
==========================================
- Coverage 89.76% 89.69% -0.08%
==========================================
Files 673 673
Lines 203944 203933 -11
Branches 39191 39131 -60
==========================================
- Hits 183080 182911 -169
- Misses 13194 13330 +136
- Partials 7670 7692 +22
🚀 New features to boost your workflow:
|
|
Thanks for the review @BridgeAR Pushed a fix for the regressions. issue was String::ValueView overhead eating simdutf gains on one-byte strings. Now I grab external one-byte pointers directly (zero-copy), skip simdutf for small one-byte strings (≤1024) using V8's native path, and apply full simdutf for two-byte strings after 128 bytes. Results: |
I used stringView in simdutf for large strings, small strings continue as they are
The benchmark result for buffers is very long, so I created a gist for this benchmark result
all results: