node icon indicating copy to clipboard operation
node copied to clipboard

benchmark: adds groups to better separate benchmarks

Open puskin opened this issue 1 year ago • 11 comments

Wandering around the codebase I found the TODO in benchmark/http/headers.js and, following the link, I discovered there was a stale PR which needed some love in order to make the TODO disappear.
Took inspiration from https://github.com/nodejs/node/pull/39285

Fixes: https://github.com/nodejs/node/issues/26425

puskin avatar Aug 15 '24 13:08 puskin

Review requested:

  • [ ] @nodejs/tsc

nodejs-github-bot avatar Aug 15 '24 13:08 nodejs-github-bot

Asking the future reviewer to re-trigger the pipeline due to flaky tests 😄

puskin avatar Aug 16 '24 17:08 puskin

@H4ad thanks for taking a look! I have just pushed to update the documentation!

puskin avatar Aug 17 '24 08:08 puskin

@H4ad I had to update test/common/benchmark.js's regex to allow multiple lines from the output because now we have cases like this:

http/end-vs-write-end.js
http/end-vs-write-end.js duration=0.05 method="write" c=1 len=1 type="asc" benchmarker="test-double-http": 307

http/headers.js
http/headers.js group="fewHeaders" duration=5 len=1 n=10 benchmarker="test-double-http": 120,485
http/headers.js group="mediumHeaders" duration=5 len=1 n=10 benchmarker="test-double-http": 117,190
http/headers.js group="manyHeaders" duration=5 len=1 n=10 benchmarker="test-double-http": 117,381

http/http_server_for_chunky_client.js
http/_chunky_http_client.js type="send" n=1 len=1: 465.4498875705796

unfortunately this kinda defeats the purpose of the whole file: making sure that only one log is outputted from each benchmark file. Any idea? Does this file still make sense to be executed according to you?

puskin avatar Aug 18 '24 06:08 puskin

@H4ad I had to update test/common/benchmark.js's regex to allow multiple lines from the output because now we have cases like this:

http/end-vs-write-end.js
http/end-vs-write-end.js duration=0.05 method="write" c=1 len=1 type="asc" benchmarker="test-double-http": 307

http/headers.js
http/headers.js group="fewHeaders" duration=5 len=1 n=10 benchmarker="test-double-http": 120,485
http/headers.js group="mediumHeaders" duration=5 len=1 n=10 benchmarker="test-double-http": 117,190
http/headers.js group="manyHeaders" duration=5 len=1 n=10 benchmarker="test-double-http": 117,381

http/http_server_for_chunky_client.js
http/_chunky_http_client.js type="send" n=1 len=1: 465.4498875705796

unfortunately this kinda defeats the purpose of the whole file: making sure that only one log is outputted from each benchmark file. Any idea? Does this file still make sense to be executed according to you?

Ignore this, I converted the script to keep groups in consideration 😄

puskin avatar Aug 18 '24 17:08 puskin

About this https://github.com/nodejs/node/pull/54393#issuecomment-2295139627, I will need to double-check if the scripts related to the benchmark output file will not be broken with this change, so I will try to take a look as soon as possible.

H4ad avatar Aug 19 '24 01:08 H4ad

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.32%. Comparing base (c1ec099) to head (8a06104). Report is 182 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #54393      +/-   ##
==========================================
+ Coverage   87.08%   87.32%   +0.23%     
==========================================
  Files         648      648              
  Lines      182217   182359     +142     
  Branches    34956    34982      +26     
==========================================
+ Hits       158684   159241     +557     
+ Misses      16819    16382     -437     
- Partials     6714     6736      +22     

see 70 files with indirect coverage changes

codecov[bot] avatar Aug 20 '24 00:08 codecov[bot]

@H4ad great! thanks for your review! I just pushed again to fix the linting issue in the docs

puskin avatar Aug 20 '24 05:08 puskin

is anything missing from this PR? could it get merged?

puskin avatar Aug 27 '24 17:08 puskin

Commit Queue failed
- Loading data for nodejs/node/pull/54393
✔  Done loading data for nodejs/node/pull/54393
----------------------------------- PR info ------------------------------------
Title      benchmark: adds groups to better separate benchmarks (#54393)
   ⚠  Could not retrieve the email or name of the PR author's from user's GitHub profile!
Branch     puskin94:benchmarks-by-groups -> nodejs:main
Labels     http, benchmark, commit-queue-squash
Commits    6
 - benchmark: adds groups to better separate benchmarks
 - doc: adjusted benchmarks docs to describe how to use the byGroups flag
 - benchmark: updated the benchmark.js file to keep in consideration groups
 - benchmark: updated the benchmark.js script to be more strict
 - doc: update benchmark description
 - doc: linting in benchmark docs and in comments in benchmark.js
Committers 2
 - Giovanni <[email protected]>
 - GitHub <[email protected]>
PR-URL: https://github.com/nodejs/node/pull/54393
Fixes: https://github.com/nodejs/node/issues/26425
Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]>
------------------------------ Generated metadata ------------------------------
PR-URL: https://github.com/nodejs/node/pull/54393
Fixes: https://github.com/nodejs/node/issues/26425
Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]>
--------------------------------------------------------------------------------
   ℹ  This PR was created on Thu, 15 Aug 2024 13:03:49 GMT
   ✔  Approvals: 1
   ✔  - Vinícius Lourenço Claro Cardoso (@H4ad): https://github.com/nodejs/node/pull/54393#pullrequestreview-2264147757
   ✔  Last GitHub CI successful
   ✘  No Jenkins CI runs detected
--------------------------------------------------------------------------------
   ✔  Aborted `git node land` session in /home/runner/work/node/node/.ncu
https://github.com/nodejs/node/actions/runs/10583649478

nodejs-github-bot avatar Aug 27 '24 18:08 nodejs-github-bot

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

nodejs-github-bot avatar Aug 27 '24 19:08 nodejs-github-bot

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

nodejs-github-bot avatar Aug 31 '24 03:08 nodejs-github-bot

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

nodejs-github-bot avatar Aug 31 '24 15:08 nodejs-github-bot

Just a last /cc @nodejs/performance in case anyone wants to take a look before merging.

H4ad avatar Sep 01 '24 05:09 H4ad

Landed in 03fe00e3da29cfe7340fd70423cb271bc5bf296f

nodejs-github-bot avatar Sep 04 '24 03:09 nodejs-github-bot