Skip to content

stream: move rejectedHandledRecord to native#64472

Closed
aduh95 wants to merge 1 commit into
nodejs:mainfrom
aduh95:reject-promise-native
Closed

stream: move rejectedHandledRecord to native#64472
aduh95 wants to merge 1 commit into
nodejs:mainfrom
aduh95:reject-promise-native

Conversation

@aduh95

@aduh95 aduh95 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Let's see if it's faster

Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. typings util Issues and PRs related to the built-in util module. web streams labels Jul 13, 2026
@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1885/

Results
                                                                       confidence improvement accuracy (*)   (**)  (***)
webstreams/creation.js kind='ReadableStream.tee' n=50000                              -0.07 %       ±0.63% ±0.83% ±1.09%
webstreams/creation.js kind='ReadableStream' n=50000                                  -3.17 %       ±5.27% ±7.02% ±9.13%
webstreams/creation.js kind='ReadableStreamBYOBReader' n=50000                        -0.34 %       ±1.28% ±1.70% ±2.21%
webstreams/creation.js kind='ReadableStreamDefaultReader' n=50000                     -1.08 %       ±1.13% ±1.50% ±1.96%
webstreams/creation.js kind='TransformStream' n=50000                                  0.76 %       ±2.42% ±3.22% ±4.19%
webstreams/creation.js kind='WritableStream' n=50000                                  -1.15 %       ±1.89% ±2.52% ±3.28%
webstreams/js_transfer.js n=10000 payload='ReadableStream'                      *     -0.66 %       ±0.60% ±0.80% ±1.04%
webstreams/js_transfer.js n=10000 payload='TransformStream'                            0.12 %       ±0.45% ±0.60% ±0.79%
webstreams/js_transfer.js n=10000 payload='WritableStream'                            -0.43 %       ±0.55% ±0.74% ±0.96%
webstreams/pipe-to.js highWaterMarkW=1024 highWaterMarkR=1024 n=500000                -1.05 %       ±1.42% ±1.90% ±2.47%
webstreams/pipe-to.js highWaterMarkW=1024 highWaterMarkR=2048 n=500000                -0.97 %       ±1.33% ±1.77% ±2.30%
webstreams/pipe-to.js highWaterMarkW=1024 highWaterMarkR=4096 n=500000                -0.45 %       ±1.08% ±1.44% ±1.87%
webstreams/pipe-to.js highWaterMarkW=1024 highWaterMarkR=512 n=500000                  0.70 %       ±1.40% ±1.86% ±2.42%
webstreams/pipe-to.js highWaterMarkW=2048 highWaterMarkR=1024 n=500000                 0.69 %       ±1.01% ±1.34% ±1.75%
webstreams/pipe-to.js highWaterMarkW=2048 highWaterMarkR=2048 n=500000                 0.95 %       ±1.35% ±1.79% ±2.33%
webstreams/pipe-to.js highWaterMarkW=2048 highWaterMarkR=4096 n=500000                -0.34 %       ±1.27% ±1.69% ±2.20%
webstreams/pipe-to.js highWaterMarkW=2048 highWaterMarkR=512 n=500000                 -0.48 %       ±1.38% ±1.84% ±2.40%
webstreams/pipe-to.js highWaterMarkW=4096 highWaterMarkR=1024 n=500000                 0.44 %       ±1.30% ±1.72% ±2.24%
webstreams/pipe-to.js highWaterMarkW=4096 highWaterMarkR=2048 n=500000                 0.74 %       ±1.11% ±1.48% ±1.92%
webstreams/pipe-to.js highWaterMarkW=4096 highWaterMarkR=4096 n=500000                -0.37 %       ±1.20% ±1.60% ±2.08%
webstreams/pipe-to.js highWaterMarkW=4096 highWaterMarkR=512 n=500000                 -0.17 %       ±1.24% ±1.64% ±2.14%
webstreams/pipe-to.js highWaterMarkW=512 highWaterMarkR=1024 n=500000                  0.90 %       ±1.32% ±1.75% ±2.29%
webstreams/pipe-to.js highWaterMarkW=512 highWaterMarkR=2048 n=500000                  0.17 %       ±1.22% ±1.62% ±2.12%
webstreams/pipe-to.js highWaterMarkW=512 highWaterMarkR=4096 n=500000                  0.06 %       ±1.33% ±1.77% ±2.30%
webstreams/pipe-to.js highWaterMarkW=512 highWaterMarkR=512 n=500000                   0.99 %       ±1.33% ±1.77% ±2.31%
webstreams/readable-async-iterator.js type='bytes' n=100000                           -0.33 %       ±1.17% ±1.55% ±2.02%
webstreams/readable-async-iterator.js type='normal' n=100000                           3.54 %       ±4.62% ±6.14% ±8.00%
webstreams/readable-read-buffered.js bufferSize=1 n=100000                            -1.24 %       ±3.04% ±4.05% ±5.30%
webstreams/readable-read-buffered.js bufferSize=10 n=100000                           -2.20 %       ±4.60% ±6.13% ±7.97%
webstreams/readable-read-buffered.js bufferSize=100 n=100000                          -1.44 %       ±4.69% ±6.24% ±8.12%
webstreams/readable-read-buffered.js bufferSize=1000 n=100000                         -1.14 %       ±4.61% ±6.15% ±8.04%
webstreams/readable-read.js type='byob' n=100000                                      -0.00 %       ±0.82% ±1.09% ±1.42%
webstreams/readable-read.js type='normal' n=100000                                    -0.24 %       ±3.13% ±4.16% ±5.42%

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

Benchmark GHA (webstreams): https://github.com/nodejs/node/actions/runs/29243127788

Results

[!WARNING]
Do not take GHA benchmark results as face value, always confirm them
using a dedicated machine, e.g. Jenkins CI.

Benchmark results:

                                                                       confidence improvement accuracy (*)    (**)   (***)
webstreams/creation.js kind='ReadableStream.tee' n=50000                               2.77 %       ±5.69%  ±7.51%  ±9.63%
webstreams/creation.js kind='ReadableStream' n=50000                                   2.91 %       ±6.30%  ±8.31% ±10.66%
webstreams/creation.js kind='ReadableStreamBYOBReader' n=50000                        -2.18 %       ±6.18%  ±8.14% ±10.45%
webstreams/creation.js kind='ReadableStreamDefaultReader' n=50000                      1.47 %       ±7.27%  ±9.59% ±12.30%
webstreams/creation.js kind='TransformStream' n=50000                                 -1.02 %       ±4.92%  ±6.48%  ±8.32%
webstreams/creation.js kind='WritableStream' n=50000                                   0.15 %       ±5.79%  ±7.63%  ±9.79%
webstreams/js_transfer.js n=10000 payload='ReadableStream'                            -1.59 %       ±9.21% ±12.14% ±15.58%
webstreams/js_transfer.js n=10000 payload='TransformStream'                           -0.15 %       ±8.54% ±11.26% ±14.45%
webstreams/js_transfer.js n=10000 payload='WritableStream'                            -0.45 %       ±9.26% ±12.20% ±15.66%
webstreams/pipe-to.js highWaterMarkW=1024 highWaterMarkR=1024 n=500000                 1.19 %       ±6.99%  ±9.22% ±11.83%
webstreams/pipe-to.js highWaterMarkW=1024 highWaterMarkR=2048 n=500000                 0.87 %       ±6.90%  ±9.10% ±11.67%
webstreams/pipe-to.js highWaterMarkW=1024 highWaterMarkR=4096 n=500000                 0.31 %       ±6.77%  ±8.92% ±11.45%
webstreams/pipe-to.js highWaterMarkW=1024 highWaterMarkR=512 n=500000                  1.58 %       ±6.75%  ±8.90% ±11.42%
webstreams/pipe-to.js highWaterMarkW=2048 highWaterMarkR=1024 n=500000                 0.58 %       ±6.74%  ±8.89% ±11.41%
webstreams/pipe-to.js highWaterMarkW=2048 highWaterMarkR=2048 n=500000                 0.70 %       ±6.86%  ±9.04% ±11.60%
webstreams/pipe-to.js highWaterMarkW=2048 highWaterMarkR=4096 n=500000                 1.02 %       ±6.98%  ±9.20% ±11.80%
webstreams/pipe-to.js highWaterMarkW=2048 highWaterMarkR=512 n=500000                  2.16 %       ±6.87%  ±9.06% ±11.62%
webstreams/pipe-to.js highWaterMarkW=4096 highWaterMarkR=1024 n=500000                 1.79 %       ±6.92%  ±9.13% ±11.71%
webstreams/pipe-to.js highWaterMarkW=4096 highWaterMarkR=2048 n=500000                 0.61 %       ±6.81%  ±8.98% ±11.52%
webstreams/pipe-to.js highWaterMarkW=4096 highWaterMarkR=4096 n=500000                -0.52 %       ±6.72%  ±8.86% ±11.36%
webstreams/pipe-to.js highWaterMarkW=4096 highWaterMarkR=512 n=500000                  2.16 %       ±6.99%  ±9.21% ±11.82%
webstreams/pipe-to.js highWaterMarkW=512 highWaterMarkR=1024 n=500000                  2.84 %       ±6.90%  ±9.10% ±11.67%
webstreams/pipe-to.js highWaterMarkW=512 highWaterMarkR=2048 n=500000                  1.19 %       ±6.78%  ±8.93% ±11.46%
webstreams/pipe-to.js highWaterMarkW=512 highWaterMarkR=4096 n=500000                  0.57 %       ±7.12%  ±9.39% ±12.04%
webstreams/pipe-to.js highWaterMarkW=512 highWaterMarkR=512 n=500000                   1.64 %       ±6.82%  ±8.99% ±11.54%
webstreams/readable-async-iterator.js type='bytes' n=100000                            1.70 %       ±6.86%  ±9.04% ±11.60%
webstreams/readable-async-iterator.js type='normal' n=100000                           1.10 %       ±4.52%  ±5.96%  ±7.65%
webstreams/readable-read-buffered.js bufferSize=1 n=100000                            -0.29 %       ±3.80%  ±5.01%  ±6.43%
webstreams/readable-read-buffered.js bufferSize=10 n=100000                            2.62 %       ±3.46%  ±4.56%  ±5.86%
webstreams/readable-read-buffered.js bufferSize=100 n=100000                          -0.02 %       ±3.50%  ±4.61%  ±5.92%
webstreams/readable-read-buffered.js bufferSize=1000 n=100000                         -1.26 %       ±3.82%  ±5.04%  ±6.47%
webstreams/readable-read.js type='byob' n=100000                                       0.23 %       ±6.62%  ±8.73% ±11.20%
webstreams/readable-read.js type='normal' n=100000                                     0.92 %       ±4.08%  ±5.38%  ±6.90%

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

[!WARNING]
Do not take GHA benchmark results as face value, always confirm them
using a dedicated machine, e.g. Jenkins CI.

@aduh95

aduh95 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Doesn't look like it's worth the added complexity

@aduh95 aduh95 closed this Jul 15, 2026
@aduh95 aduh95 deleted the reject-promise-native branch July 15, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. typings util Issues and PRs related to the built-in util module. web streams

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants