Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream: optimize creation #29135

Closed
wants to merge 3 commits into from
Closed

Conversation

ronag
Copy link
Member

@ronag ronag commented Aug 15, 2019

Optimize stream creation.

 streams/creation.js kind='duplex' n=1000000           ***      9.04 %       ±3.10% ±4.14% ±5.42%
 streams/creation.js kind='readable' n=1000000                  3.64 %       ±3.83% ±5.09% ±6.63%
 streams/creation.js kind='transform' n=1000000        ***      7.87 %       ±3.54% ±4.71% ±6.14%
 streams/creation.js kind='writable' n=1000000                 -1.11 %       ±4.99% ±6.65% ±8.68%

Takes the non-controversial parts of #29127.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added the stream Issues and PRs related to the stream subsystem. label Aug 15, 2019
@Trott
Copy link
Member

Trott commented Aug 25, 2019

@nodejs/streams

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

lib/_stream_readable.js Outdated Show resolved Hide resolved
// However, some cases require setting options to different
// values for the readable and the writable sides of the duplex stream.
// These options can be provided separately as readableXXX and writableXXX.
function ReadableState(options, isDuplex) {
Copy link
Contributor

Choose a reason for hiding this comment

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

missing the stream parameter

@ronag ronag force-pushed the stream-creation branch 3 times, most recently from e160d2a to 7ce2ad9 Compare September 12, 2019 15:54
@mscdex
Copy link
Contributor

mscdex commented Sep 12, 2019

This apparently needs a rebase in order to run benchmarks in CI.

@ronag
Copy link
Member Author

ronag commented Sep 13, 2019

rebased

@nodejs-github-bot
Copy link
Collaborator

@ronag
Copy link
Member Author

ronag commented Sep 18, 2019

@mscdex: Another try at Benchmark CI?

@ZYSzys
Copy link
Member

ZYSzys commented Sep 19, 2019

@nodejs-github-bot
Copy link
Collaborator

@Trott
Copy link
Member

Trott commented Sep 19, 2019

Benchmark results from CI:

19:26:09                                                  confidence improvement accuracy (*)   (**)  (***)
19:26:09  streams/creation.js kind='duplex' n=50000000           ***     16.85 %       ±2.12% ±2.82% ±3.67%
19:26:09  streams/creation.js kind='readable' n=50000000                  1.41 %       ±1.82% ±2.43% ±3.16%
19:26:09  streams/creation.js kind='transform' n=50000000        ***      9.88 %       ±1.71% ±2.28% ±2.96%
19:26:09  streams/creation.js kind='writable' n=50000000          **     -3.08 %       ±1.95% ±2.60% ±3.38%
19:26:09 

Seems good to me, but posting here in case anyone thinks the one slightly slower benchmark result is critical. (I imagine we're more interested in the two positive results that are both more statistically significant and larger in magnitude.)

@Trott Trott added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Sep 19, 2019
ZYSzys pushed a commit that referenced this pull request Sep 22, 2019
PR-URL: #29135
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
@ZYSzys
Copy link
Member

ZYSzys commented Sep 22, 2019

Landed in bd02775.

@ZYSzys ZYSzys closed this Sep 22, 2019
targos pushed a commit that referenced this pull request Sep 23, 2019
PR-URL: #29135
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
@BridgeAR BridgeAR mentioned this pull request Sep 24, 2019
BridgeAR pushed a commit that referenced this pull request Sep 25, 2019
PR-URL: #29135
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
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. stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants