Skip to content

Conversation

@ChALkeR
Copy link
Member

@ChALkeR ChALkeR commented Jan 28, 2026

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_decoder were 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:

  1. Speeds up utf-16le decoding about 5x
  2. Speeds up utf-16be decoding about 3x
  3. Adds fatal utf-16le support to without-intl TextDecoder
  4. Fixes utf-16le replacement for without-intl TextDecoder, previously it was silently returning wrong results
  5. Adds utf-16be support (both fatal and replacement) to without-intl TextDecoder
  6. Unifies the logic, using a single codepath everywhere for Unicode

Benchmarks

TODO

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/performance
  • @nodejs/startup

@nodejs-github-bot nodejs-github-bot added encoding Issues and PRs related to the TextEncoder and TextDecoder APIs. needs-ci PRs that need a full CI run. labels Jan 28, 2026
@ChALkeR ChALkeR force-pushed the chalker/decoder/unify/3 branch 4 times, most recently from 6fa26ff to 9e26e23 Compare January 28, 2026 06:41
@ChALkeR ChALkeR added the needs-benchmark-ci PR that need a benchmark CI run. label Jan 28, 2026
@ChALkeR ChALkeR force-pushed the chalker/decoder/unify/3 branch from 9e26e23 to 398a94e Compare January 28, 2026 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

encoding Issues and PRs related to the TextEncoder and TextDecoder APIs. needs-benchmark-ci PR that need a benchmark CI run. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants