lib: add utf16 fast path for TextDecoder#61559
Draft
ChALkeR wants to merge 1 commit intonodejs:mainfrom
Draft
Conversation
Collaborator
|
Review requested:
|
6fa26ff to
9e26e23
Compare
9e26e23 to
398a94e
Compare
398a94e to
2a30acc
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #61559 +/- ##
=======================================
Coverage 89.68% 89.69%
=======================================
Files 674 674
Lines 204048 204057 +9
Branches 39166 39174 +8
=======================================
+ Hits 183003 183020 +17
+ Misses 13352 13347 -5
+ Partials 7693 7690 -3
🚀 New features to boost your workflow:
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Tracking: #61041
Builds on top of #61549
Like that PR, this is based on the logic in https://github.com/ExodusOSS/bytes
Previously, ICU and
string_decoderwere used on with-intl and without-intl variants correspondingly for UTF-16 implementation. ICU path was slow, string_decoder path was wrong and lacked BE anyway.Instead, just use the codepath from #61549 with simple UTF-16 decoding methods.
This:
utf-16ledecoding about 5xutf-16bedecoding about 3xutf-16lesupport to without-intl TextDecoderutf-16lereplacement for without-intl TextDecoder, previously it was silently returning wrong resultsutf-16besupport (both fatal and replacement) to without-intl TextDecoderBenchmarks
TODO