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

benchmark: adds groups to better separate benchmarks #54393

Merged
merged 6 commits into from
Sep 4, 2024

Conversation

puskin94
Copy link
Contributor

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 #39285

Fixes: #26425

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/tsc

@RedYetiDev RedYetiDev added http Issues or PRs related to the http subsystem. benchmark Issues and PRs related to the benchmark subsystem. labels Aug 15, 2024
@puskin94
Copy link
Contributor Author

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

Copy link
Member

@H4ad H4ad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks for the PR, it looks great!

Can you please add a section to explain how to run the benchmarks filtering by groups? After filtering benchmarks section, you can say there are benchmarks that have groups and you can run only one or more of these groups, and put some examples of how to filter via env variable.

Eg: NODE_RUN_BENCHMARK_GROUPS=fewHeaders,manyHeaders node http/headers.js

Maybe in the future we should create a flag such as --filter.

/cc @nodejs/performance @BridgeAR

doc/contributing/writing-and-running-benchmarks.md Outdated Show resolved Hide resolved
@puskin94
Copy link
Contributor Author

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

@puskin94
Copy link
Contributor Author

@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?

@puskin94
Copy link
Contributor Author

@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 😄

@H4ad
Copy link
Member

H4ad commented Aug 19, 2024

About this #54393 (comment), 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.

Co-authored-by: Vinicius Lourenço <[email protected]>
@H4ad H4ad added the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Aug 19, 2024
Copy link
Member

@H4ad H4ad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The compare.js worked without issues, so LGTM, thanks for the contribution!

Copy link

codecov bot commented Aug 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

@puskin94
Copy link
Contributor Author

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

@puskin94
Copy link
Contributor Author

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

@H4ad H4ad added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 27, 2024
@nodejs-github-bot nodejs-github-bot added commit-queue-failed An error occurred while landing this pull request using GitHub Actions. and removed commit-queue Add this label to land a pull request using GitHub Actions. labels Aug 27, 2024
@nodejs-github-bot
Copy link
Collaborator

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

@H4ad H4ad added request-ci Add this label to start a Jenkins CI on a PR. and removed commit-queue-failed An error occurred while landing this pull request using GitHub Actions. labels Aug 27, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 27, 2024
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@H4ad
Copy link
Member

H4ad commented Sep 1, 2024

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

@H4ad H4ad added the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 4, 2024
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 4, 2024
@nodejs-github-bot nodejs-github-bot merged commit 03fe00e into nodejs:main Sep 4, 2024
61 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 03fe00e

aduh95 pushed a commit that referenced this pull request Sep 12, 2024
Fixes: #26425
Co-Authored-By: Yaman Kassir <[email protected]>
PR-URL: #54393
Reviewed-By: Vinícius Lourenço Claro Cardoso <[email protected]>
@RafaelGSS RafaelGSS mentioned this pull request Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
benchmark Issues and PRs related to the benchmark subsystem. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. http Issues or PRs related to the http subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Benchmark parameter group
4 participants