Skip to content

stream: improve write performance - #30736

Closed
ronag wants to merge 1 commit into
nodejs:masterfrom
nxtedition:stream-afterwrite3
Closed

stream: improve write performance#30736
ronag wants to merge 1 commit into
nodejs:masterfrom
nxtedition:stream-afterwrite3

Conversation

@ronag

@ronagronag commented Nov 30, 2019

Copy link
Copy Markdown
Member

This is inspired by #30710.

Depends on #30733 (which is included).

Improves performance of write by avoiding process.nextTick and a number of conditions when possible in the hot path in sync mode.

Details ``` confidence improvement accuracy (*) (**) (***) streams/writable-manywrites.js n=2000000 *** 1085.31 % ±19.19% ±25.86% ±34.31% ````

EDIT: A bit more modest improvement after #30710

 confidence improvement accuracy (*) (**) (***)
streams/writable-manywrites.js sync='no' n=2000000 0.10 % ±1.46% ±1.94% ±2.54%
streams/writable-manywrites.js sync='yes' n=2000000 *** 8.43 % ±1.73% ±2.30% ±3.00%

Note since #30733 is probably semver major, this should be the same.

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-botnodejs-github-bot added the stream Issues and PRs related to the stream subsystem. label Nov 30, 2019
@ronag

This comment has been minimized.

@ronag
ronagforce-pushed the stream-afterwrite3 branch 2 times, most recently from c1311ea to 601faebCompareNovember 30, 2019 15:23
@ronag

ronag commented Nov 30, 2019

Copy link
Copy Markdown
MemberAuthor

ping @addaleax@mcollina@mscdex

@ronag
ronagforce-pushed the stream-afterwrite3 branch 3 times, most recently from feab352 to 520388bCompareNovember 30, 2019 16:19
Comment threadlib/_stream_writable.js Outdated
@ronag
ronagforce-pushed the stream-afterwrite3 branch 4 times, most recently from 092225e to 5a99949CompareNovember 30, 2019 20:29
@addaleax

Copy link
Copy Markdown
Member

@ronag Could you review this? I’ll review this as soon as I can :)

@ronag
ronagforce-pushed the stream-afterwrite3 branch from 5a99949 to 251ce92CompareDecember 1, 2019 06:38
@ronag

ronag commented Dec 1, 2019

Copy link
Copy Markdown
MemberAuthor

@addaleax rebased

@ronag

ronag commented Dec 1, 2019

Copy link
Copy Markdown
MemberAuthor

A bit more modest improvement after #30710

 confidence improvement accuracy (*) (**) (***)
streams/writable-manywrites.js sync='no' n=2000000 0.10 % ±1.46% ±1.94% ±2.54%
streams/writable-manywrites.js sync='yes' n=2000000 *** 8.43 % ±1.73% ±2.30% ±3.00%

@ronag
ronagforce-pushed the stream-afterwrite3 branch 2 times, most recently from 6d04fa4 to 63da91bCompareDecember 1, 2019 09:38
@lpincalpinca added the semver-major PRs that contain breaking changes and should be released in the next major version. label Dec 1, 2019
@lpinca

Copy link
Copy Markdown
Member

Added semver-major label due to e828f510.

@mcollina

Copy link
Copy Markdown
Member

Let's park this until #30733 is landed

@ronag

Copy link
Copy Markdown
MemberAuthor

This needs a blocked label

@richardlaurichardlau added the blocked PRs that are blocked by other issues or PRs. label Dec 14, 2019
@ronag

Copy link
Copy Markdown
MemberAuthor

@mcollina@Trott this is no longer blocked

@TrottTrott removed the blocked PRs that are blocked by other issues or PRs. label Dec 15, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-majorPRs that contain breaking changes and should be released in the next major version.streamIssues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@ronag@addaleax@lpinca@mcollina@Trott@richardlau@nodejs-github-bot