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: improve read() performance further #29077

Closed
wants to merge 1 commit into from

Conversation

mscdex
Copy link
Contributor

@mscdex mscdex commented Aug 10, 2019

Results:

                                                        confidence improvement accuracy (*)    (**)   (***)
 streams/readable-unevenread.js n=1000                        ***      7.38 %       ±1.31%  ±1.75%  ±2.27%
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@mscdex mscdex added stream Issues and PRs related to the stream subsystem. performance Issues and PRs related to the performance of Node.js. labels Aug 10, 2019
@nodejs-github-bot
Copy link
Collaborator

const slice = data.slice(0, n);
this.head.data = data.slice(n);
return slice;
} else if (n === data.length) {
Copy link
Member

@lpinca lpinca Aug 11, 2019

Choose a reason for hiding this comment

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

Suggested change
} else if (n === data.length) {
}
if (n === data.length) {

There is a return statement in the previous if branch so I wonder if we can remove the else branch.

@nodejs-github-bot
Copy link
Collaborator

@Trott
Copy link
Member

Trott commented Aug 12, 2019

Landed in 382f84a

@Trott Trott closed this Aug 12, 2019
Trott pushed a commit to Trott/io.js that referenced this pull request Aug 12, 2019
PR-URL: nodejs#29077
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@mscdex mscdex deleted the streams-readable-perf3 branch August 13, 2019 02:57
targos pushed a commit that referenced this pull request Aug 19, 2019
PR-URL: #29077
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Issues and PRs related to the performance of Node.js. stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants