lib: add utf16 fast path for TextDecoder #61559
Draft
+239
−84
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
Only the last commit belongs to this PR
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