src: use simdutf for one-byte string UTF-8 write in stringBytes#61696
src: use simdutf for one-byte string UTF-8 write in stringBytes#61696mertcanaltin wants to merge 1 commit intonodejs:mainfrom
Conversation
|
@nodejs/performance ❤️ |
|
Triggered a benchmark CI run: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1794/ |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #61696 +/- ##
==========================================
- Coverage 89.76% 89.74% -0.02%
==========================================
Files 674 674
Lines 204424 204431 +7
Branches 39285 39288 +3
==========================================
- Hits 183504 183470 -34
- Misses 13220 13264 +44
+ Partials 7700 7697 -3
🚀 New features to boost your workflow:
|
|
@mertcanaltin Please don't click "merge to main branch" or whatever that button title is, it doesn't work with commit-queue. You have to remove your last commit and keep only the existing commit. Since you also pushed something new, we have to go through the whole process again and rebuild your pull-request. |
8de635a to
c74c73d
Compare
|
sorry. I mistakenly synced the branch. It should be solved now. |
This comment has been minimized.
This comment has been minimized.
|
This would probably be superseded by #61712? (Although the StringBytes change would likely be easier to backport.) |
|
Thanks! @Renegade334 I agree with your comment that this optimization solves the issue more effectively at the V8 layer. That said, this PR could still be useful as an easier backport option for older release lines. I'm waiting for other maintainers' comments. |
|
I like the backport plan |
Commit Queue failed- Loading data for nodejs/node/pull/61696 ✔ Done loading data for nodejs/node/pull/61696 ----------------------------------- PR info ------------------------------------ Title src: use simdutf for one-byte string UTF-8 write in stringBytes (#61696) Author Mert Can Altin <mertgold60@gmail.com> (@mertcanaltin) Branch mertcanaltin:mert/simdutf-write-utf8 -> nodejs:main Labels buffer, c++, author ready, needs-ci Commits 1 - src: use simdutf for one-byte string UTF-8 write in stringBytes Committers 1 - Mert Can Altin <mertgold60@gmail.com> PR-URL: https://github.com/nodejs/node/pull/61696 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Daniel Lemire <daniel@lemire.me> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/61696 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Daniel Lemire <daniel@lemire.me> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> -------------------------------------------------------------------------------- ℹ This PR was created on Thu, 05 Feb 2026 19:11:13 GMT ✔ Approvals: 8 ✔ - Yagiz Nizipli (@anonrig) (TSC): https://github.com/nodejs/node/pull/61696#pullrequestreview-3764386119 ✔ - Stephen Belanger (@Qard): https://github.com/nodejs/node/pull/61696#pullrequestreview-3758974723 ✔ - Daniel Lemire (@lemire): https://github.com/nodejs/node/pull/61696#pullrequestreview-3759154723 ✔ - Vinícius Lourenço Claro Cardoso (@H4ad): https://github.com/nodejs/node/pull/61696#pullrequestreview-3759180179 ✔ - Сковорода Никита Андреевич (@ChALkeR): https://github.com/nodejs/node/pull/61696#pullrequestreview-3759185771 ✔ - Gürgün Dayıoğlu (@gurgunday): https://github.com/nodejs/node/pull/61696#pullrequestreview-3759188442 ✔ - Anna Henningsen (@addaleax): https://github.com/nodejs/node/pull/61696#pullrequestreview-3767062000 ✔ - René (@Renegade334): https://github.com/nodejs/node/pull/61696#pullrequestreview-3767064889 ✘ Last GitHub CI failed ℹ Last Benchmark CI on 2026-02-05T19:18:39Z: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1794/ ℹ Last Full PR CI on 2026-02-07T13:32:20Z: https://ci.nodejs.org/job/node-test-pull-request/71229/ - Querying data for job/node-test-pull-request/71229/ ✔ Build data downloaded ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/21785408042 |
Commit Queue failed- Loading data for nodejs/node/pull/61696 ✔ Done loading data for nodejs/node/pull/61696 ----------------------------------- PR info ------------------------------------ Title src: use simdutf for one-byte string UTF-8 write in stringBytes (#61696) Author Mert Can Altin <mertgold60@gmail.com> (@mertcanaltin) Branch mertcanaltin:mert/simdutf-write-utf8 -> nodejs:main Labels buffer, c++, author ready, needs-ci Commits 1 - src: use simdutf for one-byte string UTF-8 write in stringBytes Committers 1 - Mert Can Altin <mertgold60@gmail.com> PR-URL: https://github.com/nodejs/node/pull/61696 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Daniel Lemire <daniel@lemire.me> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> ------------------------------ Generated metadata ------------------------------ PR-URL: https://github.com/nodejs/node/pull/61696 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Daniel Lemire <daniel@lemire.me> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> -------------------------------------------------------------------------------- ℹ This PR was created on Thu, 05 Feb 2026 19:11:13 GMT ✔ Approvals: 8 ✔ - Yagiz Nizipli (@anonrig) (TSC): https://github.com/nodejs/node/pull/61696#pullrequestreview-3764386119 ✔ - Stephen Belanger (@Qard): https://github.com/nodejs/node/pull/61696#pullrequestreview-3758974723 ✔ - Daniel Lemire (@lemire): https://github.com/nodejs/node/pull/61696#pullrequestreview-3759154723 ✔ - Vinícius Lourenço Claro Cardoso (@H4ad): https://github.com/nodejs/node/pull/61696#pullrequestreview-3759180179 ✔ - Сковорода Никита Андреевич (@ChALkeR): https://github.com/nodejs/node/pull/61696#pullrequestreview-3759185771 ✔ - Gürgün Dayıoğlu (@gurgunday): https://github.com/nodejs/node/pull/61696#pullrequestreview-3759188442 ✔ - Anna Henningsen (@addaleax): https://github.com/nodejs/node/pull/61696#pullrequestreview-3767062000 ✔ - René (@Renegade334): https://github.com/nodejs/node/pull/61696#pullrequestreview-3767064889 ✘ Last GitHub CI failed ℹ Last Benchmark CI on 2026-02-07T19:14:26Z: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1794/ ℹ Last Full PR CI on 2026-02-07T19:14:26Z: https://ci.nodejs.org/job/node-test-pull-request/71229/ - Querying data for job/node-test-pull-request/1794/ ✔ Last Jenkins CI successful -------------------------------------------------------------------------------- ✔ Aborted `git node land` session in /home/runner/work/node/node/.ncuhttps://github.com/nodejs/node/actions/runs/21785918980 |
|
The last set of actions were cursed by the GHA outage. |
PR-URL: #61696 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Daniel Lemire <daniel@lemire.me> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
|
Landed in 28979fb |
I use simdutf::convert_latin1_to_utf8_safe for one-byte strings in StringBytes::Write UTF-8 path instead of V8's
WriteUtf8V2.
buffer.write(str, 'utf8') 577% faster
benchmark results: