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

worker: refactor to avoid unsafe array iteration #36735

Merged
merged 1 commit into from
Jan 13, 2021

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Jan 2, 2021

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

@aduh95 aduh95 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
Contributor Author

aduh95 commented Jan 2, 2021

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

lib/internal/worker.js Outdated Show resolved Hide resolved
lib/internal/worker.js Outdated Show resolved Hide resolved
@aduh95
Copy link
Contributor Author

aduh95 commented Jan 2, 2021

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.

                                                                         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 (***)

@aduh95 aduh95 removed the needs-benchmark-ci PR that need a benchmark CI run. label Jan 2, 2021
lib/internal/worker/io.js Outdated Show resolved Hide resolved
lib/internal/worker/io.js Outdated Show resolved Hide resolved
@targos
Copy link
Member

targos commented Jan 3, 2021

typo: woker -> worker

@aduh95 aduh95 changed the title woker: refactor to avoid unsafe array iteration worker: refactor to avoid unsafe array iteration Jan 3, 2021
@aduh95
Copy link
Contributor Author

aduh95 commented Jan 3, 2021

typo: woker -> worker

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

@ronag ronag requested a review from addaleax January 3, 2021 11:42
@aduh95 aduh95 added the review wanted PRs that need reviews. label Jan 9, 2021
@aduh95 aduh95 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
@aduh95 aduh95 self-assigned this Jan 12, 2021
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Jan 13, 2021
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

PR-URL: nodejs#36735
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@aduh95
Copy link
Contributor Author

aduh95 commented Jan 13, 2021

Landed in 7c37e04

@aduh95 aduh95 merged commit 7c37e04 into nodejs:master Jan 13, 2021
@aduh95 aduh95 deleted the worker-array-iteration branch January 13, 2021 14:44
@ruyadorno ruyadorno 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>
@ruyadorno ruyadorno mentioned this pull request Jan 22, 2021
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. worker Issues and PRs related to Worker support.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants