Skip to content

stream: only pass the expected number of parameters to callbacks#63909

Open
aduh95 wants to merge 2 commits into
nodejs:mainfrom
aduh95:stream-no-variadic-args
Open

stream: only pass the expected number of parameters to callbacks#63909
aduh95 wants to merge 2 commits into
nodejs:mainfrom
aduh95:stream-no-variadic-args

Conversation

@aduh95

@aduh95 aduh95 commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Extracted from #63876

Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Matteo Collina <hello@matteocollina.com>

@mcollina mcollina 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 Jun 14, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jun 14, 2026
@nodejs-github-bot

nodejs-github-bot commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/74116/
Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1870/

Benchmark results
                                                                       confidence improvement accuracy (*)   (**)  (***)
webstreams/creation.js kind='ReadableStream.tee' n=50000                              -0.13 %       ±0.68% ±0.90% ±1.18%
webstreams/creation.js kind='ReadableStream' n=50000                                  -0.25 %       ±1.23% ±1.64% ±2.13%
webstreams/creation.js kind='ReadableStreamBYOBReader' n=50000                         1.23 %       ±1.74% ±2.32% ±3.02%
webstreams/creation.js kind='ReadableStreamDefaultReader' n=50000                     -0.40 %       ±3.84% ±5.12% ±6.66%
webstreams/creation.js kind='TransformStream' n=50000                                 -0.11 %       ±0.94% ±1.25% ±1.63%
webstreams/creation.js kind='WritableStream' n=50000                                   0.12 %       ±0.73% ±0.97% ±1.27%
webstreams/js_transfer.js n=10000 payload='ReadableStream'                            -0.38 %       ±0.69% ±0.92% ±1.20%
webstreams/js_transfer.js n=10000 payload='TransformStream'                            0.07 %       ±0.50% ±0.66% ±0.87%
webstreams/js_transfer.js n=10000 payload='WritableStream'                             0.05 %       ±0.45% ±0.59% ±0.77%
webstreams/pipe-to.js highWaterMarkW=1024 highWaterMarkR=1024 n=500000                -0.58 %       ±1.36% ±1.82% ±2.37%
webstreams/pipe-to.js highWaterMarkW=1024 highWaterMarkR=2048 n=500000                -0.50 %       ±0.99% ±1.31% ±1.71%
webstreams/pipe-to.js highWaterMarkW=1024 highWaterMarkR=4096 n=500000                 0.18 %       ±1.26% ±1.67% ±2.18%
webstreams/pipe-to.js highWaterMarkW=1024 highWaterMarkR=512 n=500000                  0.25 %       ±1.24% ±1.65% ±2.14%
webstreams/pipe-to.js highWaterMarkW=2048 highWaterMarkR=1024 n=500000                -0.61 %       ±1.25% ±1.66% ±2.16%
webstreams/pipe-to.js highWaterMarkW=2048 highWaterMarkR=2048 n=500000                -0.56 %       ±1.06% ±1.41% ±1.84%
webstreams/pipe-to.js highWaterMarkW=2048 highWaterMarkR=4096 n=500000                 0.75 %       ±1.21% ±1.62% ±2.11%
webstreams/pipe-to.js highWaterMarkW=2048 highWaterMarkR=512 n=500000                 -0.04 %       ±1.19% ±1.59% ±2.07%
webstreams/pipe-to.js highWaterMarkW=4096 highWaterMarkR=1024 n=500000          *     -1.77 %       ±1.38% ±1.84% ±2.39%
webstreams/pipe-to.js highWaterMarkW=4096 highWaterMarkR=2048 n=500000                 0.03 %       ±1.29% ±1.71% ±2.23%
webstreams/pipe-to.js highWaterMarkW=4096 highWaterMarkR=4096 n=500000                 0.73 %       ±1.22% ±1.63% ±2.12%
webstreams/pipe-to.js highWaterMarkW=4096 highWaterMarkR=512 n=500000                 -1.33 %       ±1.44% ±1.91% ±2.49%
webstreams/pipe-to.js highWaterMarkW=512 highWaterMarkR=1024 n=500000           *      1.62 %       ±1.26% ±1.67% ±2.18%
webstreams/pipe-to.js highWaterMarkW=512 highWaterMarkR=2048 n=500000                  0.49 %       ±1.17% ±1.56% ±2.03%
webstreams/pipe-to.js highWaterMarkW=512 highWaterMarkR=4096 n=500000                  0.95 %       ±1.10% ±1.46% ±1.90%
webstreams/pipe-to.js highWaterMarkW=512 highWaterMarkR=512 n=500000                   0.52 %       ±1.10% ±1.47% ±1.91%
webstreams/readable-async-iterator.js n=100000                                         2.29 %       ±2.69% ±3.58% ±4.67%
webstreams/readable-read-buffered.js bufferSize=1 n=100000                             0.34 %       ±1.53% ±2.04% ±2.66%
webstreams/readable-read-buffered.js bufferSize=10 n=100000                            0.67 %       ±3.56% ±4.74% ±6.17%
webstreams/readable-read-buffered.js bufferSize=100 n=100000                          -1.29 %       ±2.58% ±3.44% ±4.50%
webstreams/readable-read-buffered.js bufferSize=1000 n=100000                  **     -3.72 %       ±2.69% ±3.58% ±4.67%
webstreams/readable-read.js type='byob' n=100000                                       0.42 %       ±1.04% ±1.39% ±1.80%
webstreams/readable-read.js type='normal' n=100000                                     0.01 %       ±2.04% ±2.72% ±3.55%

Be aware that when doing many comparisons the risk of a false-positive
result increases. In this case, there are 32 comparisons, you can thus
expect the following amount of false-positive results:
  1.60 false positives, when considering a   5% risk acceptance (*, **, ***),
  0.32 false positives, when considering a   1% risk acceptance (**, ***),
  0.03 false positives, when considering a 0.1% risk acceptance (***)

@mcollina

Copy link
Copy Markdown
Member

This is not the main bottleneck of that other PR, so this won't
move the needle right now.

@nodejs-github-bot

Copy link
Copy Markdown
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. web streams

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants