node icon indicating copy to clipboard operation
node copied to clipboard

lib: speed up MessageEvent creation internally

Open KhafraDev opened this issue 1 year ago • 6 comments
trafficstars

createFastMessageEvent can be used when the arguments passed to the MessageEvent constructor do not need to be validated.

Refs: https://github.com/nodejs/undici/pull/3170 Refs: https://github.com/nodejs/node/pull/52370#pullrequestreview-1984568503

KhafraDev avatar May 12 '24 02:05 KhafraDev

Benchmark CI: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1561/

benjamingr avatar May 12 '24 06:05 benjamingr

Benchmarks look great:

10:03:02                                                                         confidence improvement accuracy (*)   (**)  (***)
10:03:02 worker/atomics-wait.js n=10000000                                                       0.05 %       ±0.59% ±0.79% ±1.03%
10:03:02 worker/bench-eventlooputil.js method='ELU_passed' n=1000000                             0.64 %       ±0.67% ±0.90% ±1.18%
10:03:02 worker/bench-eventlooputil.js method='ELU_simple' n=1000000                             0.07 %       ±0.52% ±0.69% ±0.90%
10:03:02 worker/echo.js n=100000 sendsPerBroadcast=1 payload='object' workers=1                  0.12 %       ±0.69% ±0.92% ±1.19%
10:03:02 worker/echo.js n=100000 sendsPerBroadcast=1 payload='string' workers=1                  0.18 %       ±0.71% ±0.95% ±1.24%
10:03:02 worker/echo.js n=100000 sendsPerBroadcast=10 payload='object' workers=1        ***      2.73 %       ±0.71% ±0.95% ±1.24%
10:03:02 worker/echo.js n=100000 sendsPerBroadcast=10 payload='string' workers=1        ***      3.17 %       ±1.13% ±1.51% ±1.96%
10:03:02 worker/messageport.js n=1000000 style='eventemitter' payload='object'                  -0.06 %       ±0.36% ±0.48% ±0.63%
10:03:02 worker/messageport.js n=1000000 style='eventemitter' payload='string'                  -0.54 %       ±0.55% ±0.74% ±0.97%
10:03:02 worker/messageport.js n=1000000 style='eventtarget' payload='object'           ***     46.14 %       ±0.81% ±1.09% ±1.43%
10:03:02 worker/messageport.js n=1000000 style='eventtarget' payload='string'           ***     90.95 %       ±0.54% ±0.72% ±0.93%
10:03:02   0.55 false positives, when considering a   5% risk acceptance (*, **, ***),
10:03:02   0.11 false positives, when considering a   1% risk acceptance (**, ***),
10:03:02   0.01 false positives, when considering a 0.1% risk acceptance (***)


benjamingr avatar May 12 '24 07:05 benjamingr

CI: https://ci.nodejs.org/job/node-test-pull-request/59164/

nodejs-github-bot avatar May 12 '24 09:05 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/59254/

nodejs-github-bot avatar May 16 '24 19:05 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/59272/

nodejs-github-bot avatar May 17 '24 17:05 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/59287/

nodejs-github-bot avatar May 18 '24 10:05 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/59541/

nodejs-github-bot avatar May 30 '24 16:05 nodejs-github-bot

CI: https://ci.nodejs.org/job/node-test-pull-request/59542/

nodejs-github-bot avatar May 30 '24 16:05 nodejs-github-bot

Commit Queue failed
- Loading data for nodejs/node/pull/52951
✔  Done loading data for nodejs/node/pull/52951
----------------------------------- PR info ------------------------------------
Title      lib: speed up MessageEvent creation internally (#52951)
Author     Khafra  (@KhafraDev)
Branch     KhafraDev:use-fast-create-messageevent -> nodejs:main
Labels     author ready, worker, needs-ci
Commits    2
 - lib: speed up MessageEvent creation internally
 - fixup
Committers 1
 - Khafra 
PR-URL: https://github.com/nodejs/node/pull/52951
Refs: https://github.com/nodejs/undici/pull/3170
Reviewed-By: Benjamin Gruenbaum 
Reviewed-By: Matteo Collina 
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/52951
Refs: https://github.com/nodejs/undici/pull/3170
Reviewed-By: Benjamin Gruenbaum 
Reviewed-By: Matteo Collina 
--------------------------------------------------------------------------------
   ℹ  This PR was created on Sun, 12 May 2024 02:53:03 GMT
   ✔  Approvals: 2
   ✔  - Benjamin Gruenbaum (@benjamingr) (TSC): https://github.com/nodejs/node/pull/52951#pullrequestreview-2052434926
   ✔  - Matteo Collina (@mcollina) (TSC): https://github.com/nodejs/node/pull/52951#pullrequestreview-2071390736
   ✔  Last GitHub CI successful
   ℹ  Last Benchmark CI on 2024-05-12T06:53:30Z: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/1561/
   ℹ  Last Full PR CI on 2024-05-30T16:17:26Z: https://ci.nodejs.org/job/node-test-pull-request/59542/
- Querying data for job/node-test-pull-request/59542/
   ✔  Last Jenkins CI successful
--------------------------------------------------------------------------------
   ✔  No git cherry-pick in progress
   ✔  No git am in progress
   ✔  No git rebase in progress
--------------------------------------------------------------------------------
- Bringing origin/main up to date...
From https://github.com/nodejs/node
 * branch                  main       -> FETCH_HEAD
✔  origin/main is now up-to-date
- Downloading patch for 52951
From https://github.com/nodejs/node
 * branch                  refs/pull/52951/merge -> FETCH_HEAD
✔  Fetched commits as 75fe4f35d4e5..29c44f31e535
--------------------------------------------------------------------------------
[main bac899986b] lib: speed up MessageEvent creation internally
 Author: Khafra 
 Date: Sat May 11 22:49:27 2024 -0400
 1 file changed, 6 insertions(+), 5 deletions(-)
[main 849a35ded2] fixup
 Author: Khafra 
 Date: Mon May 13 01:47:55 2024 -0400
 1 file changed, 2 insertions(+)
   ✔  Patches applied
There are 2 commits in the PR. Attempting autorebase.
Rebasing (2/4)

Executing: git node land --amend --yes --------------------------------- New Message ---------------------------------- lib: speed up MessageEvent creation internally

PR-URL: https://github.com/nodejs/node/pull/52951 Refs: https://github.com/nodejs/undici/pull/3170 Reviewed-By: Benjamin Gruenbaum [email protected] Reviewed-By: Matteo Collina [email protected]

[detached HEAD 4e7a2d0a67] lib: speed up MessageEvent creation internally Author: Khafra [email protected] Date: Sat May 11 22:49:27 2024 -0400 1 file changed, 6 insertions(+), 5 deletions(-) Rebasing (3/4) Rebasing (4/4)

Executing: git node land --amend --yes --------------------------------- New Message ---------------------------------- fixup

PR-URL: https://github.com/nodejs/node/pull/52951 Refs: https://github.com/nodejs/undici/pull/3170 Reviewed-By: Benjamin Gruenbaum [email protected] Reviewed-By: Matteo Collina [email protected]

[detached HEAD 28d971d85f] fixup Author: Khafra [email protected] Date: Mon May 13 01:47:55 2024 -0400 1 file changed, 2 insertions(+)

Successfully rebased and updated refs/heads/main.

ℹ Add commit-queue-squash label to land the PR as one commit, or commit-queue-rebase to land as separate commits.

https://github.com/nodejs/node/actions/runs/9532972963

nodejs-github-bot avatar Jun 16 '24 03:06 nodejs-github-bot

Landed in 672e4ccf0507dd7893e36adb10929d99687dbcaa

nodejs-github-bot avatar Jun 16 '24 03:06 nodejs-github-bot