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

buffer: improve concat() performance #31522

Closed
wants to merge 1 commit into from

Conversation

mscdex
Copy link
Contributor

@mscdex mscdex commented Jan 26, 2020

Benchmark results:

                                                                              confidence improvement accuracy (*)   (**)  (***)
 buffers/buffer-concat-fill.js n=800000 extraSize=1                                 ***     23.65 %       ±1.60% ±2.13% ±2.78%
 buffers/buffer-concat-fill.js n=800000 extraSize=1024                              ***     12.27 %       ±1.06% ±1.41% ±1.84%
 buffers/buffer-concat-fill.js n=800000 extraSize=256                               ***     19.62 %       ±1.42% ±1.89% ±2.46%
 buffers/buffer-concat.js n=800000 withTotalLength=0 pieceSize=1 pieces=16          ***    112.83 %       ±4.56% ±6.08% ±7.93%
 buffers/buffer-concat.js n=800000 withTotalLength=0 pieceSize=1 pieces=4           ***     78.89 %       ±2.94% ±3.95% ±5.24%
 buffers/buffer-concat.js n=800000 withTotalLength=0 pieceSize=16 pieces=16         ***     97.94 %       ±0.62% ±0.82% ±1.08%
 buffers/buffer-concat.js n=800000 withTotalLength=0 pieceSize=16 pieces=4          ***     79.88 %       ±1.41% ±1.88% ±2.45%
 buffers/buffer-concat.js n=800000 withTotalLength=0 pieceSize=256 pieces=16        ***     13.59 %       ±1.84% ±2.46% ±3.24%
 buffers/buffer-concat.js n=800000 withTotalLength=0 pieceSize=256 pieces=4         ***     37.14 %       ±1.92% ±2.55% ±3.33%
 buffers/buffer-concat.js n=800000 withTotalLength=1 pieceSize=1 pieces=16          ***    110.13 %       ±4.85% ±6.46% ±8.42%
 buffers/buffer-concat.js n=800000 withTotalLength=1 pieceSize=1 pieces=4           ***     70.24 %       ±2.66% ±3.54% ±4.61%
 buffers/buffer-concat.js n=800000 withTotalLength=1 pieceSize=16 pieces=16         ***     93.56 %       ±3.87% ±5.19% ±6.84%
 buffers/buffer-concat.js n=800000 withTotalLength=1 pieceSize=16 pieces=4          ***     72.01 %       ±1.72% ±2.29% ±2.98%
 buffers/buffer-concat.js n=800000 withTotalLength=1 pieceSize=256 pieces=16        ***     11.80 %       ±2.57% ±3.42% ±4.47%
 buffers/buffer-concat.js n=800000 withTotalLength=1 pieceSize=256 pieces=4         ***     36.90 %       ±1.17% ±1.56% ±2.03%
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

@mscdex mscdex added buffer Issues and PRs related to the buffer subsystem. performance Issues and PRs related to the performance of Node.js. labels Jan 26, 2020
@nodejs-github-bot
Copy link
Collaborator

@mscdex mscdex force-pushed the buffer-improve-concat-perf branch from 75a907c to 6ff3aa6 Compare January 27, 2020 00:42
@mscdex
Copy link
Contributor Author

mscdex commented Jan 27, 2020

Also swapped out the .fill() in .concat() for a more direct byte-based fill and included a benchmark for it.

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@addaleax addaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 28, 2020
@Trott
Copy link
Member

Trott commented Jan 29, 2020

Landed in 2170259

@Trott Trott closed this Jan 29, 2020
Trott pushed a commit that referenced this pull request Jan 29, 2020
PR-URL: #31522
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
@mscdex mscdex deleted the buffer-improve-concat-perf branch January 29, 2020 09:23
codebytere pushed a commit that referenced this pull request Feb 17, 2020
PR-URL: #31522
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
@codebytere codebytere mentioned this pull request Feb 17, 2020
codebytere pushed a commit that referenced this pull request Mar 15, 2020
PR-URL: #31522
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
codebytere pushed a commit that referenced this pull request Mar 17, 2020
PR-URL: #31522
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
@codebytere codebytere mentioned this pull request Mar 17, 2020
codebytere pushed a commit that referenced this pull request Mar 30, 2020
PR-URL: #31522
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
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. buffer Issues and PRs related to the buffer subsystem. performance Issues and PRs related to the performance of Node.js.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants