Skip to content

Conversation

@ronag
Copy link
Member

@ronag ronag commented Oct 27, 2025

Instead of wasting cycles concatenating buffers, just return each one by one.

@ronag ronag requested a review from mcollina October 27, 2025 18:44
@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Oct 27, 2025

Review requested:

  • @nodejs/streams

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. stream Issues and PRs related to the stream subsystem. labels Oct 27, 2025
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

code lgtm

I think some docs changes are needed

@mcollina mcollina added the semver-major PRs that contain breaking changes and should be released in the next major version. label Jan 2, 2026
@mcollina
Copy link
Member

mcollina commented Jan 2, 2026

Marked as semver-major.

@lpinca
Copy link
Member

lpinca commented Jan 2, 2026

I'm -1 on this unless there is a strong reason for it. Historically, readable.read() has always returned all queued data. If this lands, I think that the easiest workaround for modules affected by the breaking change would be replacing readable.read() with readable.read(readable.readableLength).

@ronag
Copy link
Member Author

ronag commented Jan 2, 2026

I'm -1 on this unless there is a strong reason for it.

The performance overhead is huge. As it stand we should at least add a note to avoid this api for anything performance sensitive.

If this lands, I think that the easiest workaround for modules affected by the breaking change would be replacing readable.read() with readable.read(readable.readableLength).

Good point.

@ronag
Copy link
Member Author

ronag commented Jan 2, 2026

I think some docs changes are needed

What doc changes are you roughly asking for?

@ronag ronag force-pushed the read-no-copy branch 2 times, most recently from a380c35 to 0798db8 Compare January 2, 2026 08:55
ronag added a commit to ronag/node that referenced this pull request Jan 2, 2026
Instead of wasting cycles concatenating buffers, just return each
one by one.

Old behavior can be achieved by using `readable.read(readable.readableLength)` instead of `readable.read()`.

PR: nodejs#60441
@ronag ronag marked this pull request as ready for review January 2, 2026 08:56
@ronag ronag added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 2, 2026
ronag added a commit to ronag/node that referenced this pull request Jan 2, 2026
Instead of wasting cycles concatenating buffers, just return each
one by one.

Old behavior can be achieved by using `readable.read(readable.readableLength)` instead of `readable.read()`.

PR: nodejs#60441
ronag added a commit to ronag/node that referenced this pull request Jan 2, 2026
Instead of wasting cycles concatenating buffers, just return each
one by one.

Old behavior can be achieved by using `readable.read(readable.readableLength)` instead of `readable.read()`.

PR: nodejs#60441
ronag added a commit to ronag/node that referenced this pull request Jan 2, 2026
Instead of wasting cycles concatenating buffers, just return each
one by one.

Old behavior can be achieved by using `readable.read(readable.readableLength)` instead of `readable.read()`.

PR: nodejs#60441
@github-actions github-actions bot added request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Jan 2, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 2, 2026

Failed to start CI
   ⚠  Commits were pushed since the last approving review:
   ⚠  - stream: readable read one buffer at a time
   ✘  Refusing to run CI on potentially unsafe PR
https://github.com/nodejs/node/actions/runs/20654449594

@ronag ronag added request-ci Add this label to start a Jenkins CI on a PR. and removed request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. labels Jan 2, 2026
@github-actions github-actions bot added request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Jan 2, 2026
@codecov
Copy link

codecov bot commented Jan 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.53%. Comparing base (0457bfe) to head (87cabd8).
⚠️ Report is 21 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #60441      +/-   ##
==========================================
- Coverage   88.53%   88.53%   -0.01%     
==========================================
  Files         704      704              
  Lines      208736   208764      +28     
  Branches    40274    40278       +4     
==========================================
+ Hits       184810   184821      +11     
+ Misses      15944    15936       -8     
- Partials     7982     8007      +25     
Files with missing lines Coverage Δ
lib/internal/streams/readable.js 96.27% <100.00%> (+0.01%) ⬆️

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

lpinca added a commit to websockets/ws that referenced this pull request Jan 2, 2026
Do not rely on undocumented behavior, call `socket.read()` with the actual
number of bytes to read.

Refs: nodejs/node#60441
Co-authored-by: Luigi Pinca <luigipinca@gmail.com>
@ronag ronag added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 3, 2026
@ronag ronag added request-ci Add this label to start a Jenkins CI on a PR. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Jan 3, 2026
@github-actions github-actions bot added request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Jan 3, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 3, 2026

Failed to start CI
   ⚠  Commits were pushed since the last approving review:
   ⚠  - stream: readable read one buffer at a time
   ⚠  - Update test/parallel/test-stream-readable-readable-one.js
   ⚠  - fixup
   ✘  Refusing to run CI on potentially unsafe PR
https://github.com/nodejs/node/actions/runs/20683777042

@ronag ronag added request-ci Add this label to start a Jenkins CI on a PR. and removed request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. labels Jan 3, 2026
@github-actions github-actions bot added request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. and removed request-ci Add this label to start a Jenkins CI on a PR. labels Jan 3, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 3, 2026

Failed to start CI
   ⚠  Commits were pushed since the last approving review:
   ⚠  - stream: readable read one buffer at a time
   ⚠  - Update test/parallel/test-stream-readable-readable-one.js
   ⚠  - fixup
   ✘  Refusing to run CI on potentially unsafe PR
https://github.com/nodejs/node/actions/runs/20683908897

Copy link
Member

@mcollina mcollina left a comment

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 Jan 4, 2026
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 4, 2026
@nodejs-github-bot
Copy link
Collaborator

@ronag ronag added request-ci Add this label to start a Jenkins CI on a PR. and removed request-ci-failed An error occurred while starting CI via request-ci label, and manual interventon is needed. labels Jan 4, 2026
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 4, 2026
@nodejs-github-bot
Copy link
Collaborator

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@ronag ronag added the request-ci Add this label to start a Jenkins CI on a PR. label Jan 5, 2026
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 5, 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

needs-ci PRs that need a full CI run. needs-citgm PRs that need a CITGM CI run. semver-major PRs that contain breaking changes and should be released in the next major version. stream Issues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants