Skip to content

Conversation

@ChALkeR
Copy link
Member

@ChALkeR ChALkeR commented Dec 19, 2025

Tracking: #61041

Don't expect buffer.isAscii common-case to be ASCII, as that's exposed as a public API for checks.
The error version has better performance on non-ascii as it returns early, which could easily be e.g. >10x.

Refs: #46271 (comment),

But somehow the _errors version is also faster on ASCII, which was supposed to be a common case for validate_ascii?
I'm not sure what's up, might be a simdutf bug? cc @lemire

On another note: v8 is also likely using validate_ascii incorrectly

buffer.isAscii perf:

main:

Test Size Throughput Mean Time
Latin lipsum (ASCII) 84.902 KiB 105.08 GiB/s 0.001 ms
Arabic lipsum 79.771 KiB 103.88 GiB/s 0.001 ms
Chinese lipsum 68.203 KiB 101.78 GiB/s 0.001 ms

PR

Test Size Throughput Mean Time
Latin lipsum (ASCII) 84.902 KiB 117.97 GiB/s 0.001 ms
Arabic lipsum 79.771 KiB 1836.47 GiB/s 0.000 ms
Chinese lipsum 68.203 KiB 1564.76 GiB/s 0.000 ms

@nodejs-github-bot nodejs-github-bot added buffer Issues and PRs related to the buffer subsystem. c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Dec 19, 2025
@ChALkeR ChALkeR marked this pull request as ready for review December 19, 2025 09:50
@ChALkeR ChALkeR changed the title src: use validate_ascii_with_errors instead of validate_asci src: use validate_ascii_with_errors instead of validate_ascii Dec 19, 2025
@ChALkeR ChALkeR changed the title src: use validate_ascii_with_errors instead of validate_ascii src: use validate_ascii_with_errors for buffer.isAscii Dec 19, 2025
@codecov
Copy link

codecov bot commented Dec 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.52%. Comparing base (4f24aff) to head (e78cdd1).
⚠️ Report is 390 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #61122      +/-   ##
==========================================
- Coverage   88.53%   88.52%   -0.02%     
==========================================
  Files         703      703              
  Lines      208546   208547       +1     
  Branches    40217    40217              
==========================================
- Hits       184634   184607      -27     
- Misses      15926    15949      +23     
- Partials     7986     7991       +5     
Files with missing lines Coverage Δ
src/node_buffer.cc 68.90% <100.00%> (+0.03%) ⬆️

... and 46 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@lemire lemire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the ping.

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

Copy link
Member

@gurgunday gurgunday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@gurgunday gurgunday added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 26, 2026
@nodejs-github-bot
Copy link
Collaborator

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

@nodejs-github-bot
Copy link
Collaborator

@gurgunday
Copy link
Member

Should we just merge this? I can't restart the macOS CI

@lemire lemire added request-ci Add this label to start a Jenkins CI on a PR. commit-queue Add this label to land a pull request using GitHub Actions. labels Feb 10, 2026
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Feb 10, 2026
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Feb 11, 2026
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/61122
✔  Done loading data for nodejs/node/pull/61122
----------------------------------- PR info ------------------------------------
Title      src: use validate_ascii_with_errors for buffer.isAscii (#61122)
Author     Nikita Skovoroda <chalkerx@gmail.com> (@ChALkeR)
Branch     ChALkeR:chalker/ascii/is/0 -> nodejs:main
Labels     buffer, c++, author ready, needs-ci
Commits    1
 - src: use validate_ascii_with_errors instead of validate_ascii
Committers 1
 - Nikita Skovoroda <chalkerx@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/61122
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/61122
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Fri, 19 Dec 2025 09:36:22 GMT
   ✔  Approvals: 4
   ✔  - Colin Ihrig (@cjihrig): https://github.com/nodejs/node/pull/61122#pullrequestreview-3599469348
   ✔  - Daniel Lemire (@lemire): https://github.com/nodejs/node/pull/61122#pullrequestreview-3600703637
   ✔  - Rafael Gonzaga (@RafaelGSS) (TSC): https://github.com/nodejs/node/pull/61122#pullrequestreview-3674328458
   ✔  - Gürgün Dayıoğlu (@gurgunday): https://github.com/nodejs/node/pull/61122#pullrequestreview-3708188048
   ✘  Last GitHub CI failed
   ℹ  Last Full PR CI on 2026-02-10T20:42:11Z: https://ci.nodejs.org/job/node-test-pull-request/71299/
- Querying data for job/node-test-pull-request/71299/
✔  Build data downloaded
- Querying failures of job/node-test-commit/85408/
✔  Data downloaded
   ✘  1 failure(s) on the last Jenkins CI run
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/21888296181

@ChALkeR ChALkeR added the request-ci Add this label to start a Jenkins CI on a PR. label Feb 11, 2026
@ChALkeR
Copy link
Member Author

ChALkeR commented Feb 11, 2026

Jenkins CI was fine and didn't need to be restarted (but it apparently does now)
GH CI is stuck, who can restart it?

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

@ChALkeR ChALkeR added the request-ci Add this label to start a Jenkins CI on a PR. label Feb 11, 2026
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Feb 11, 2026
@nodejs-github-bot
Copy link
Collaborator

@ChALkeR ChALkeR added commit-queue Add this label to land a pull request using GitHub Actions. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Feb 11, 2026
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Feb 11, 2026
@nodejs-github-bot
Copy link
Collaborator

Commit Queue failed
- Loading data for nodejs/node/pull/61122
✔  Done loading data for nodejs/node/pull/61122
----------------------------------- PR info ------------------------------------
Title      src: use validate_ascii_with_errors for buffer.isAscii (#61122)
Author     Nikita Skovoroda <chalkerx@gmail.com> (@ChALkeR)
Branch     ChALkeR:chalker/ascii/is/0 -> nodejs:main
Labels     buffer, c++, author ready, needs-ci
Commits    1
 - src: use validate_ascii_with_errors instead of validate_ascii
Committers 1
 - Nikita Skovoroda <chalkerx@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/61122
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/61122
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Fri, 19 Dec 2025 09:36:22 GMT
   ✔  Approvals: 4
   ✔  - Colin Ihrig (@cjihrig): https://github.com/nodejs/node/pull/61122#pullrequestreview-3599469348
   ✔  - Daniel Lemire (@lemire): https://github.com/nodejs/node/pull/61122#pullrequestreview-3600703637
   ✔  - Rafael Gonzaga (@RafaelGSS) (TSC): https://github.com/nodejs/node/pull/61122#pullrequestreview-3674328458
   ✔  - Gürgün Dayıoğlu (@gurgunday): https://github.com/nodejs/node/pull/61122#pullrequestreview-3708188048
   ✘  Last GitHub CI failed
   ℹ  Last Full PR CI on 2026-02-11T03:43:31Z: https://ci.nodejs.org/job/node-test-pull-request/71303/
- Querying data for job/node-test-pull-request/71303/
✔  Build data downloaded
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/21898227534

Copy link
Member

@mertcanaltin mertcanaltin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@targos
Copy link
Member

targos commented Feb 11, 2026

GitHub CI can't be restarted. I think it's too old.

@ChALkeR ChALkeR added the request-ci Add this label to start a Jenkins CI on a PR. label Feb 11, 2026
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Feb 11, 2026
@nodejs-github-bot
Copy link
Collaborator

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. buffer Issues and PRs related to the buffer subsystem. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-failed An error occurred while landing this pull request using GitHub Actions. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants