src: optimize utf-8 byte length calculation using simdutf#61601
src: optimize utf-8 byte length calculation using simdutf#61601mertcanaltin wants to merge 2 commits intonodejs:mainfrom
Conversation
BridgeAR
left a comment
There was a problem hiding this comment.
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.75% -0.02%
==========================================
Files 673 673
Lines 203944 203952 +8
Branches 39191 39194 +3
==========================================
- Hits 183080 183052 -28
- Misses 13194 13226 +32
- Partials 7670 7674 +4
🚀 New features to boost your workflow:
|
|
Thanks for the review @BridgeAR Pushed a fix for the regressions and updated results 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: |
@BridgeAR can you rereview? the benchmarks seems to be unstable enough to show differences in untriggered paths |
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: