Skip to content

buffer: improve from() performance - #31615

Merged
mscdex merged 1 commit into
nodejs:masterfrom
mscdex:buffer-improve-from-uint8array-perf
Feb 9, 2020
Merged

buffer: improve from() performance#31615
mscdex merged 1 commit into
nodejs:masterfrom
mscdex:buffer-improve-from-uint8array-perf

Conversation

@mscdex

@mscdexmscdex commented Feb 2, 2020

Copy link
Copy Markdown
Contributor

Benchmark results:

 confidence improvement accuracy (*) (**) (***)
buffers/buffer-from.js n=800000 len=100 source='array' *** 53.81 % ±2.01% ±2.70% ±3.59%
buffers/buffer-from.js n=800000 len=100 source='buffer' *** 53.09 % ±1.91% ±2.54% ±3.30%
buffers/buffer-from.js n=800000 len=100 source='object' *** 11.22 % ±2.92% ±3.89% ±5.07%
buffers/buffer-from.js n=800000 len=100 source='uint16array' *** 47.57 % ±1.62% ±2.16% ±2.82%
buffers/buffer-from.js n=800000 len=100 source='uint8array' *** 52.46 % ±1.88% ±2.53% ±3.34%
buffers/buffer-from.js n=800000 len=2048 source='array' *** 147.71 % ±1.20% ±1.61% ±2.13%
buffers/buffer-from.js n=800000 len=2048 source='buffer' *** 8.93 % ±1.23% ±1.64% ±2.14%
buffers/buffer-from.js n=800000 len=2048 source='object' *** 8.92 % ±3.90% ±5.20% ±6.78%
buffers/buffer-from.js n=800000 len=2048 source='uint16array' *** 313.08 % ±1.83% ±2.46% ±3.26%
buffers/buffer-from.js n=800000 len=2048 source='uint8array' *** 6.70 % ±1.64% ±2.20% ±2.89%
buffers/buffer-from.js n=800000 len=8192 source='array' *** 47.04 % ±0.90% ±1.21% ±1.60%
buffers/buffer-from.js n=800000 len=8192 source='buffer' *** 6.58 % ±2.14% ±2.86% ±3.73%
buffers/buffer-from.js n=800000 len=8192 source='object' *** 10.50 % ±2.70% ±3.60% ±4.71%
buffers/buffer-from.js n=800000 len=8192 source='uint16array' *** 338.05 % ±3.12% ±4.21% ±5.58%
buffers/buffer-from.js n=800000 len=8192 source='uint8array' *** 5.25 % ±1.99% ±2.65% ±3.45%
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@mscdexmscdex added buffer Issues and PRs related to the buffer subsystem. performance Issues and PRs related to the performance of Node.js. labels Feb 2, 2020
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@mscdexmscdex added the wip Issues and PRs that are still a work in progress. label Feb 2, 2020
@jasnell

Copy link
Copy Markdown
Member

@mscdex ... just curious, why is this work in progress? Seems straightforward enough.

@mscdex
mscdexforce-pushed the buffer-improve-from-uint8array-perf branch from 8c7ca32 to 3deb306CompareFebruary 2, 2020 21:05
@mscdexmscdex changed the title buffer: improve from(uint8array) performancebuffer: improve from() performanceFeb 2, 2020
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@mscdex

Copy link
Copy Markdown
ContributorAuthor

@jasnell I found additional changes that provided even greater benefit.

@mscdexmscdex removed the wip Issues and PRs that are still a work in progress. label Feb 2, 2020
@addaleaxaddaleax added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Feb 7, 2020
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

PR-URL: nodejs#31615
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@mscdex
mscdexforce-pushed the buffer-improve-from-uint8array-perf branch from 3deb306 to 74291e4CompareFebruary 9, 2020 02:41
@mscdex
mscdex merged commit 74291e4 into nodejs:masterFeb 9, 2020
@mscdex
mscdex deleted the buffer-improve-from-uint8array-perf branch February 9, 2020 02:42
codebytere pushed a commit that referenced this pull request Feb 17, 2020
PR-URL: #31615
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@codebyterecodebytere mentioned this pull request Feb 17, 2020
codebytere pushed a commit that referenced this pull request Mar 15, 2020
PR-URL: #31615
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
codebytere pushed a commit that referenced this pull request Mar 17, 2020
PR-URL: #31615
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@codebyterecodebytere mentioned this pull request Mar 17, 2020
codebytere pushed a commit that referenced this pull request Mar 30, 2020
PR-URL: #31615
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.bufferIssues and PRs related to the buffer subsystem.performanceIssues and PRs related to the performance of Node.js.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@mscdex@nodejs-github-bot@jasnell@addaleax