lib: add utf16 fast path for TextDecoder#61559
Draft
ChALkeR wants to merge 2 commits intonodejs:mainfrom
Draft
Conversation
Collaborator
|
Review requested:
|
6fa26ff to
9e26e23
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.72% 89.70% -0.02%
==========================================
Files 675 675
Lines 204806 204824 +18
Branches 39355 39355
==========================================
- Hits 183761 183738 -23
- Misses 13330 13363 +33
- Partials 7715 7723 +8
🚀 New features to boost your workflow:
|
2a30acc to
60a1400
Compare
d88096e to
4a91b6f
Compare
4a91b6f to
b1f8aa3
Compare
ChALkeR
commented
Feb 18, 2026
Comment on lines
+5
to
+6
| const MAX_N = 256 * 1024; | ||
| const TOTAL_SIZE = 256 * 1024 * 1024; |
Member
Author
There was a problem hiding this comment.
This is quite slow esp when run 30 times on CI
I wanted to denoise it though as otherwise it's still noisy even on e.g. 2x less numbers
If slow benchmarks are an issue I can exclude this change
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
Better reviewed with whitespace hidden.
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 3xutf-16bedecoding about 2xutf-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
https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1804/