Skip to content

stream: speed up reads and iteration over default WHATWG streams#64320

Open
mcollina wants to merge 1 commit into
nodejs:mainfrom
mcollina:webstream-iterator-perf-round6
Open

stream: speed up reads and iteration over default WHATWG streams#64320
mcollina wants to merge 1 commit into
nodejs:mainfrom
mcollina:webstream-iterator-perf-round6

Conversation

@mcollina

@mcollina mcollina commented Jul 6, 2026

Copy link
Copy Markdown
Member

Skip the size algorithm call when it is the default one, and stop re-running the full ShouldCallPull predicate at per-chunk call sites where its inputs are already established.

readable-async-iterator type=normal: +16.6% (***)
readable-read-buffered: +13.9% to +27.5% (**/***)
pipe-to: +3.7% to +6.0% (15/16 configs significant)

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/performance

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. web streams labels Jul 6, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@mcollina mcollina force-pushed the webstream-iterator-perf-round6 branch from 31fb1fe to e16a18d Compare July 7, 2026 17:53
@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.25%. Comparing base (7036199) to head (0ff7249).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #64320   +/-   ##
=======================================
  Coverage   90.25%   90.25%           
=======================================
  Files         741      741           
  Lines      241207   241249   +42     
  Branches    45424    45444   +20     
=======================================
+ Hits       217696   217734   +38     
- Misses      15087    15089    +2     
- Partials     8424     8426    +2     
Files with missing lines Coverage Δ
lib/internal/webstreams/readablestream.js 98.18% <100.00%> (+0.02%) ⬆️

... and 26 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.

@mertcanaltin mertcanaltin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. label Jul 8, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 8, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Skip the size algorithm call and its result validation when the size
algorithm is the default one, and stop re-running the full
ShouldCallPull predicate at per-chunk call sites where its inputs are
already established.

readable-async-iterator type=normal: +16.6% (***)
readable-read-buffered: +13.9% to +27.5% (**/***)
pipe-to: +3.7% to +6.0% (15/16 configs significant)

Signed-off-by: Matteo Collina <hello@matteocollina.com>
@mcollina mcollina force-pushed the webstream-iterator-perf-round6 branch from e16a18d to 0ff7249 Compare July 9, 2026 09:15
@aduh95 aduh95 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. labels Jul 9, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jul 9, 2026
@nodejs-github-bot

nodejs-github-bot commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

@gurgunday gurgunday left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

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. needs-ci PRs that need a full CI run. web streams

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants