src: improve textEncoder encode performance with simdutf by mertcanaltin · Pull Request #61496 · nodejs/node · GitHub
Skip to content

src: improve textEncoder encode performance with simdutf#61496

Merged
nodejs-github-bot merged 1 commit intonodejs:mainfrom
mertcanaltin:mert/textencoder-encode-simdutf
Jan 30, 2026
Merged

src: improve textEncoder encode performance with simdutf#61496
nodejs-github-bot merged 1 commit intonodejs:mainfrom
mertcanaltin:mert/textencoder-encode-simdutf

Conversation

@mertcanaltin
Copy link
Copy Markdown
Member

@mertcanaltin mertcanaltin commented Jan 23, 2026

Ref: cloudflare/workerd#5448

Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1789/

                                                                               confidence improvement accuracy (*)   (**)  (***)
util/text-encoder.js op='encode' type='ascii' n=1000000 len=1024                      ***     11.86 %       ±1.25% ±1.66% ±2.17%
util/text-encoder.js op='encode' type='ascii' n=1000000 len=256                       ***     -7.82 %       ±1.84% ±2.46% ±3.22%
util/text-encoder.js op='encode' type='ascii' n=1000000 len=32                          *      1.26 %       ±1.19% ±1.59% ±2.07%
util/text-encoder.js op='encode' type='ascii' n=1000000 len=8192                      ***    146.74 %       ±0.78% ±1.05% ±1.39%
util/text-encoder.js op='encode' type='one-byte-string' n=1000000 len=1024            ***     20.69 %       ±0.79% ±1.05% ±1.37%
util/text-encoder.js op='encode' type='one-byte-string' n=1000000 len=256             ***      7.46 %       ±0.79% ±1.05% ±1.37%
util/text-encoder.js op='encode' type='one-byte-string' n=1000000 len=32                      -0.57 %       ±0.91% ±1.21% ±1.58%
util/text-encoder.js op='encode' type='one-byte-string' n=1000000 len=8192            ***    182.16 %       ±0.22% ±0.29% ±0.39%
util/text-encoder.js op='encode' type='two-byte-string' n=1000000 len=1024            ***     95.53 %       ±1.09% ±1.47% ±1.95%
util/text-encoder.js op='encode' type='two-byte-string' n=1000000 len=256             ***     32.64 %       ±0.90% ±1.20% ±1.58%
util/text-encoder.js op='encode' type='two-byte-string' n=1000000 len=32                      -0.23 %       ±1.04% ±1.38% ±1.80%
util/text-encoder.js op='encode' type='two-byte-string' n=1000000 len=8192            ***    299.06 %       ±0.64% ±0.86% ±1.14%
util/text-encoder.js op='encodeInto' type='ascii' n=1000000 len=1024                           2.14 %       ±3.97% ±5.29% ±6.88%
util/text-encoder.js op='encodeInto' type='ascii' n=1000000 len=256                            1.22 %       ±3.31% ±4.41% ±5.75%
util/text-encoder.js op='encodeInto' type='ascii' n=1000000 len=32                    ***     20.60 %       ±2.77% ±3.69% ±4.80%
util/text-encoder.js op='encodeInto' type='ascii' n=1000000 len=8192                           0.91 %       ±3.13% ±4.16% ±5.42%
util/text-encoder.js op='encodeInto' type='one-byte-string' n=1000000 len=1024                 1.21 %       ±5.16% ±6.88% ±8.99%
util/text-encoder.js op='encodeInto' type='one-byte-string' n=1000000 len=256                 -0.65 %       ±1.12% ±1.49% ±1.94%
util/text-encoder.js op='encodeInto' type='one-byte-string' n=1000000 len=32                  -0.48 %       ±3.29% ±4.38% ±5.70%
util/text-encoder.js op='encodeInto' type='one-byte-string' n=1000000 len=8192                -1.57 %       ±1.69% ±2.25% ±2.94%
util/text-encoder.js op='encodeInto' type='two-byte-string' n=1000000 len=1024                -0.51 %       ±0.69% ±0.92% ±1.20%
util/text-encoder.js op='encodeInto' type='two-byte-string' n=1000000 len=256                 -0.38 %       ±0.67% ±0.89% ±1.16%
util/text-encoder.js op='encodeInto' type='two-byte-string' n=1000000 len=32            *     -2.35 %       ±2.05% ±2.73% ±3.55%
util/text-encoder.js op='encodeInto' type='two-byte-string' n=1000000 len=8192          *     -0.32 %       ±0.31% ±0.41% ±0.54%

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Jan 23, 2026
@mertcanaltin mertcanaltin marked this pull request as draft January 23, 2026 19:47
@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 23, 2026

@mertcanaltin mertcanaltin marked this pull request as ready for review January 30, 2026 19:20
@mertcanaltin mertcanaltin force-pushed the mert/textencoder-encode-simdutf branch from 0c17bf1 to 2b60e66 Compare January 30, 2026 19:31
@anonrig
Copy link
Copy Markdown
Member

anonrig commented Jan 30, 2026

cc @nodejs/performance please review

@anonrig anonrig added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. notable-change PRs with changes that should be highlighted in changelogs. labels Jan 30, 2026
@github-actions
Copy link
Copy Markdown
Contributor

The notable-change PRs with changes that should be highlighted in changelogs. label has been added by @anonrig.

Please suggest a text for the release notes if you'd like to include a more detailed summary, then proceed to update the PR description with the text or a link to the notable change suggested text comment. Otherwise, the commit will be placed in the Other Notable Changes section.

@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 30, 2026
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

@nodejs nodejs locked and limited conversation to collaborators Jan 30, 2026
@nodejs nodejs unlocked this conversation Jan 30, 2026
@anonrig
Copy link
Copy Markdown
Member

anonrig commented Jan 30, 2026

@IlyasShabi why did you locked and limited the conversation to collaborators?

@IlyasShabi
Copy link
Copy Markdown
Member

@anonrig oh! Sorry didn't know what happened, didn't mean to do it.

@anonrig anonrig added the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 30, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 30, 2026
@nodejs-github-bot nodejs-github-bot merged commit f200685 into nodejs:main Jan 30, 2026
74 checks passed
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Landed in f200685

aduh95 pushed a commit that referenced this pull request Feb 2, 2026
PR-URL: #61496
Refs: cloudflare/workerd#5448
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
nodejs-github-bot added a commit that referenced this pull request Feb 2, 2026
Notable changes:

async_hooks:
  * (SEMVER-MINOR) add trackPromises option to createHook() (Joyee Cheung) #61415
src:
  * improve textEncoder encode performance with simdutf (Mert Can Altin) #61496
stream:
  * (SEMVER-MINOR) add bytes() method to stream/consumers (wantaek) #60426
test_runner:
  * (SEMVER-MINOR) add env option to run function (Ethan Arrowood) #61367
url:
  * update ada to v3.4.2 and support unicode 17 (Yagiz Nizipli) #61593

PR-URL: #61635
aduh95 pushed a commit that referenced this pull request Feb 2, 2026
PR-URL: #61496
Refs: cloudflare/workerd#5448
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
aduh95 added a commit that referenced this pull request Feb 2, 2026
Notable changes:

async_hooks:
  * (SEMVER-MINOR) add `trackPromises` option to `createHook()` (Joyee Cheung) #61415
net:
  * (SEMVER-MINOR) add `setTOS` and `getTOS` to `Socket` (Amol Yadav) #61503
src:
  * (SEMVER-MINOR) add initial support for ESM in embedder API (Joyee Cheung) #61548
  * improve `TextEncoder` encode performance with `simdutf` (Mert Can Altin) #61496
stream:
  * (SEMVER-MINOR) add `bytes()` method to `node:stream/consumers` (wantaek) #60426
test_runner:
  * (SEMVER-MINOR) add `env` option to `run` function (Ethan Arrowood) #61367
url:
  * update Ada to v3.4.2 and support Unicode 17 (Yagiz Nizipli) #61593

PR-URL: #61635
aduh95 added a commit that referenced this pull request Feb 2, 2026
Notable changes:

async_hooks:
  * (SEMVER-MINOR) add `trackPromises` option to `createHook()` (Joyee Cheung) #61415
net:
  * (SEMVER-MINOR) add `setTOS` and `getTOS` to `Socket` (Amol Yadav) #61503
src:
  * (SEMVER-MINOR) add initial support for ESM in embedder API (Joyee Cheung) #61548
  * improve `TextEncoder` encode performance with `simdutf` (Mert Can Altin) #61496
stream:
  * (SEMVER-MINOR) add `bytes()` method to `node:stream/consumers` (wantaek) #60426
test_runner:
  * (SEMVER-MINOR) add `env` option to `run` function (Ethan Arrowood) #61367
url:
  * update Ada to v3.4.2 and support Unicode 17 (Yagiz Nizipli) #61593

PR-URL: #61635
aduh95 added a commit that referenced this pull request Feb 3, 2026
Notable changes:

async_hooks:
  * (SEMVER-MINOR) add `trackPromises` option to `createHook()` (Joyee Cheung) #61415
net:
  * (SEMVER-MINOR) add `setTOS` and `getTOS` to `Socket` (Amol Yadav) #61503
src:
  * (SEMVER-MINOR) add initial support for ESM in embedder API (Joyee Cheung) #61548
  * improve `TextEncoder` encode performance with `simdutf` (Mert Can Altin) #61496
stream:
  * (SEMVER-MINOR) add `bytes()` method to `node:stream/consumers` (wantaek) #60426
test_runner:
  * (SEMVER-MINOR) add `env` option to `run` function (Ethan Arrowood) #61367
url:
  * update Ada to v3.4.2 and support Unicode 17 (Yagiz Nizipli) #61593

PR-URL: #61635
@aduh95 aduh95 added the backport-requested-v24.x PRs awaiting manual backport to the v24.x-staging branch. label Mar 9, 2026
@aduh95
Copy link
Copy Markdown
Contributor

aduh95 commented Mar 9, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. backport-requested-v24.x PRs awaiting manual backport to the v24.x-staging branch. c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. notable-change PRs with changes that should be highlighted in changelogs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants