GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — stream: improve WebStreams creation performance by rluvaton · Pull Request #49089 · nodejs/node

Conversation

@rluvaton

@rluvaton rluvaton commented Aug 9, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

From my local tests, this improves the benchmark/webstreams/creation.js by 2 to 3 times

could someone please run the benchmark in the CI

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

imranbarbhuiya, micheleriva, and aminya reacted with heart emoji bricss and H4ad reacted with eyes emoji
All reactions
  • ❤️ 3 reactions
  • 👀 2 reactions
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. web streams Issues and PRs related to the Web Streams API. labels Aug 9, 2023
@Xstoudi

Xstoudi commented Aug 10, 2023

Copy link
Copy Markdown
Contributor

Ubuntu on WSL2

Without the change:

webstreams/creation.js kind="ReadableStream" n=50000: 245,842.89135667187
webstreams/creation.js kind="TransformStream" n=50000: 64,412.45274303109
webstreams/creation.js kind="WritableStream" n=50000: 235,646.29630427333

With change:

webstreams/creation.js kind="ReadableStream" n=50000: 796,678.8307839505
webstreams/creation.js kind="TransformStream" n=50000: 137,357.95549408294
webstreams/creation.js kind="WritableStream" n=50000: 503,433.1675202359

If values are rates and not times, your change seems to improve it on my end too!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@debadree25

debadree25 commented Aug 10, 2023

Copy link
Copy Markdown
Contributor

Seems to be failing a lot of WPTs too

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

debadree25
debadree25 reviewed Aug 10, 2023
View reviewed changes
Comment thread lib/internal/webstreams/readablestream.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@rluvaton rluvaton changed the title stream: improve WebStreams performance stream: improve WebStreams creation performance Aug 10, 2023
@rluvaton

rluvaton commented Aug 10, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

https://github.com/nodejs/node/blob/52d32bdfbd88d7abd19365daad07b7e7c9f423fd/test/fixtures/wpt/streams/idlharness.any.js test fail, anyone knows why?

Edit: fixed the tests

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mcollina

mcollina commented Aug 10, 2023

Copy link
Copy Markdown
Member

cc @jasnell

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

rluvaton added 5 commits August 10, 2023 20:11
@rluvaton
stream: improve WebStreams performance
470c7a1
@rluvaton
stream: format
2b4ef06
@rluvaton
stream: wip
3276266
@rluvaton
stream: fix test failures
7e021fd
@rluvaton
stream: cleanup
ede6c54
@rluvaton
rluvaton force-pushed the improve-webstream-perf branch from 4bb72eb to ede6c54 Compare August 10, 2023 17:11
rluvaton added 3 commits August 10, 2023 20:24
@rluvaton
stream: fix tests
fe25995
@rluvaton
stream: improve perf
54e8215
@rluvaton
stream: remove fn
5c53418
@rluvaton

rluvaton commented Aug 10, 2023

Copy link
Copy Markdown
Member Author

fixed the tests

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rluvaton
stream: improve ReadableStreamBYOBRequest
e5a3f9e
@mcollina mcollina added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Aug 11, 2023
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Aug 11, 2023
@nodejs-github-bot

nodejs-github-bot commented Aug 11, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/53181/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@anonrig anonrig added needs-benchmark-ci PRs that need a benchmark CI run. performance Issues and PRs related to the performance of Node.js. labels Aug 11, 2023
@anonrig

anonrig commented Aug 11, 2023

Copy link
Copy Markdown
Member

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rluvaton

rluvaton commented Aug 11, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

benchmark output:

                                                       confidence improvement accuracy (*)   (**)   (***)
webstreams/creation.js kind='ReadableStream' n=50000         ***    144.39 %       ±6.00% ±8.00% ±10.45%
webstreams/creation.js kind='TransformStream' n=50000        ***     98.61 %       ±3.81% ±5.11%  ±6.72%
webstreams/creation.js kind='WritableStream' n=50000         ***     85.25 %       ±6.30% ±8.44% ±11.08%
 
Be aware that when doing many comparisons the risk of a false-positive
result increases. In this case, there are 3 comparisons, you can thus
expect the following amount of false-positive results:
  0.15 false positives, when considering a   5% risk acceptance (*, **, ***),
  0.03 false positives, when considering a   1% risk acceptance (**, ***),
  0.00 false positives, when considering a 0.1% risk acceptance (***)
benjamingr reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mcollina
mcollina approved these changes Aug 11, 2023
View reviewed changes

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

lgtm

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
anonrig
anonrig approved these changes Aug 11, 2023
View reviewed changes
@anonrig anonrig added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Aug 11, 2023
@nodejs-github-bot

nodejs-github-bot commented Aug 11, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/53203/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rluvaton

rluvaton commented Aug 12, 2023

Copy link
Copy Markdown
Member Author

Can you please retry the CI, the tests seems to be flaky

atlowChemi reacted with eyes emoji
All reactions
  • 👀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@atlowChemi

atlowChemi commented Aug 12, 2023

Copy link
Copy Markdown
Member

Can you please retry the CI, the tests seems to be flaky

Most of the failures are related to #49059 (comment)

rluvaton reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Aug 12, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/53244/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Aug 12, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/53249/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot mentioned this pull request Aug 13, 2023
CI Reliability 2023-08-13 nodejs/reliability#635
Open
29 tasks
@nodejs-github-bot

nodejs-github-bot commented Aug 13, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/53264/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

benjamingr
benjamingr approved these changes Aug 13, 2023
View reviewed changes
@atlowChemi atlowChemi added commit-queue PRs queued for automated landing through the Commit Queue. commit-queue-squash PRs the Commit Queue should land as one squashed commit. labels Aug 13, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Aug 13, 2023
@nodejs-github-bot
nodejs-github-bot merged commit 9fc5700 into nodejs:main Aug 13, 2023
@nodejs-github-bot

nodejs-github-bot commented Aug 13, 2023

Copy link
Copy Markdown
Collaborator

Landed in 9fc5700

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rluvaton
rluvaton deleted the improve-webstream-perf branch August 13, 2023 08:56
@github-actions github-actions Bot mentioned this pull request Aug 14, 2023
CI Reliability 2023-08-14 nodejs/reliability#636
Open
25 tasks
Ceres6 pushed a commit to Ceres6/node that referenced this pull request Aug 14, 2023
@rluvaton @Ceres6
stream: improve WebStreams performance
8d47964
PR-URL: nodejs#49089
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
@github-actions github-actions Bot mentioned this pull request Aug 15, 2023
CI Reliability 2023-08-15 nodejs/reliability#637
Open
22 tasks
RafaelGSS pushed a commit that referenced this pull request Aug 15, 2023
@rluvaton @RafaelGSS
stream: improve WebStreams performance
46a1fe9
PR-URL: #49089
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
@UlisesGascon UlisesGascon mentioned this pull request Aug 15, 2023
v20.6.0 proposal #49185
Merged
RafaelGSS pushed a commit to RafaelGSS/node that referenced this pull request Aug 15, 2023
@rluvaton @RafaelGSS
stream: improve WebStreams performance
5d73a58
PR-URL: nodejs#49089
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
RafaelGSS pushed a commit that referenced this pull request Aug 16, 2023
@rluvaton @RafaelGSS
stream: improve WebStreams performance
e87ce4b
PR-URL: #49089
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
RafaelGSS pushed a commit that referenced this pull request Aug 17, 2023
@rluvaton @RafaelGSS
stream: improve WebStreams performance
600c08d
PR-URL: #49089
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
@leeoniya leeoniya mentioned this pull request Sep 5, 2023
make both node & web stream example the same leeoniya/uDSV#1
Open
@rluvaton rluvaton mentioned this pull request Sep 11, 2023
Performance of WHATWG ReadableStream.read() nodejs/performance#82
Open
targos pushed a commit that referenced this pull request Nov 27, 2023
@rluvaton @targos
stream: improve WebStreams performance
d585d13
PR-URL: #49089
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
@targos targos mentioned this pull request Nov 28, 2023
v18.19.0 release proposal #50953
Merged
sercher added a commit to sercher/graaljs that referenced this pull request Apr 25, 2024
@sercher
stream: improve WebStreams performance
30d3968
PR-URL: nodejs/node#49089
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
sercher added a commit to sercher/graaljs that referenced this pull request Apr 25, 2024
@sercher
stream: improve WebStreams performance
d719ef1
PR-URL: nodejs/node#49089
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@mcollina mcollina mcollina approved these changes
@benjamingr benjamingr benjamingr approved these changes
@anonrig anonrig anonrig approved these changes
+1 more reviewer
@debadree25 debadree25 debadree25 left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. commit-queue-squash PRs the Commit Queue should land as one squashed commit. needs-benchmark-ci PRs that need a benchmark CI run. needs-ci PRs that need a full CI run. performance Issues and PRs related to the performance of Node.js. web streams Issues and PRs related to the Web Streams API.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

8 participants

@rluvaton @Xstoudi @debadree25 @mcollina @nodejs-github-bot @anonrig @atlowChemi @benjamingr
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.