Skip to content

worker: refactor to avoid unsafe array iteration - #36735

Merged
aduh95 merged 1 commit into
nodejs:masterfrom
aduh95:worker-array-iteration
Jan 13, 2021
Merged

worker: refactor to avoid unsafe array iteration#36735
aduh95 merged 1 commit into
nodejs:masterfrom
aduh95:worker-array-iteration

Conversation

@aduh95

Copy link
Copy Markdown
Contributor
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@aduh95aduh95 added worker Issues and PRs related to Worker support. needs-benchmark-ci PR that need a benchmark CI run. labels Jan 2, 2021
@aduh95

Copy link
Copy Markdown
ContributorAuthor

Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/854/ (queued, will 404 until it starts)

Comment threadlib/internal/worker.js Outdated
Comment threadlib/internal/worker.js Outdated
@aduh95

Copy link
Copy Markdown
ContributorAuthor

Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/854/ (queued, will 404 until it starts)

No perf improvements or regressions.

Details
 confidence improvement accuracy (*) (**) (***)
worker/atomics-wait.js n=10000000 1.04 % ±2.91% ±3.87% ±5.04%
worker/bench-eventlooputil.js method='ELU_passed' n=1000000 0.22 % ±2.25% ±2.99% ±3.89%
worker/bench-eventlooputil.js method='ELU_simple' n=1000000 -0.90 % ±2.30% ±3.06% ±3.98%
worker/echo.js n=100000 sendsPerBroadcast=10 payload='object' workers=1 2.86 % ±5.65% ±7.52% ±9.78%
worker/echo.js n=100000 sendsPerBroadcast=10 payload='string' workers=1 -0.66 % ±4.81% ±6.40% ±8.34%
worker/echo.js n=100000 sendsPerBroadcast=1 payload='object' workers=1 -2.49 % ±3.08% ±4.12% ±5.38%
worker/echo.js n=100000 sendsPerBroadcast=1 payload='string' workers=1 0.16 % ±3.32% ±4.42% ±5.76%
worker/messageport.js n=1000000 style='eventemitter' payload='object' 2.89 % ±3.42% ±4.57% ±5.98%
worker/messageport.js n=1000000 style='eventemitter' payload='string' 0.74 % ±3.30% ±4.42% ±5.83%
worker/messageport.js n=1000000 style='eventtarget' payload='object' 2.41 % ±2.81% ±3.75% ±4.89%
worker/messageport.js n=1000000 style='eventtarget' payload='string' 2.82 % ±4.47% ±5.99% ±7.89%
Be aware that when doing many comparisons the risk of a false-positive
result increases. In this case there are 11 comparisons, you can thus
expect the following amount of false-positive results:
0.55 false positives, when considering a 5% risk acceptance (*, **, ***),
0.11 false positives, when considering a 1% risk acceptance (**, ***),
0.01 false positives, when considering a 0.1% risk acceptance (***)

@aduh95aduh95 removed the needs-benchmark-ci PR that need a benchmark CI run. label Jan 2, 2021
Comment threadlib/internal/worker/io.js Outdated
Comment threadlib/internal/worker/io.js Outdated
@targos

Copy link
Copy Markdown
Member

typo: woker -> worker

@aduh95aduh95 changed the title woker: refactor to avoid unsafe array iterationworker: refactor to avoid unsafe array iterationJan 3, 2021
@aduh95

Copy link
Copy Markdown
ContributorAuthor

typo: woker -> worker

Good catch! I'll fix that on/if landing if that's OK.

@ronag
ronag requested a review from addaleaxJanuary 3, 2021 11:42
@aduh95aduh95 added the review wanted PRs that need reviews. label Jan 9, 2021
@aduh95aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Jan 12, 2021
@aduh95aduh95 self-assigned this Jan 12, 2021
@github-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 13, 2021
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

PR-URL: nodejs#36735
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@aduh95
aduh95force-pushed the worker-array-iteration branch from 7f9a136 to 7c37e04CompareJanuary 13, 2021 14:43
@aduh95

Copy link
Copy Markdown
ContributorAuthor

Landed in 7c37e04

@aduh95
aduh95 merged commit 7c37e04 into nodejs:masterJan 13, 2021
@aduh95
aduh95 deleted the worker-array-iteration branch January 13, 2021 14:44
@ruyadornoruyadorno removed the review wanted PRs that need reviews. label Jan 21, 2021
ruyadorno pushed a commit that referenced this pull request Jan 22, 2021
PR-URL: #36735
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@ruyadornoruyadorno mentioned this pull request Jan 22, 2021
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.workerIssues and PRs related to Worker support.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@aduh95@targos@nodejs-github-bot@jasnell@Trott@RaisinTen@ruyadorno