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

Fix broken bench scripts #1291

Merged
merged 3 commits into from Mar 20, 2022
Merged

Fix broken bench scripts #1291

merged 3 commits into from Mar 20, 2022

Conversation

mcollina
Copy link
Member

Our bench CI job is not working anymore. This PR partially fixes it but the number of iterations do not work anymore.

[bench:run] │ Tests               │ Samples │          Result │ Tolerance │ Difference with slowest │
[bench:run] |─────────────────────|─────────|─────────────────|───────────|─────────────────────────|
[bench:run] │ undici - fetch      │       1 │  596.19 req/sec │  ± 0.00 % │                       - │
[bench:run] |─────────────────────|─────────|─────────────────|───────────|─────────────────────────|
[bench:run] │ http - no keepalive │       1 │ 1123.28 req/sec │  ± 0.00 % │               + 88.41 % │
[bench:run] |─────────────────────|─────────|─────────────────|───────────|─────────────────────────|
[bench:run] │ http - keepalive    │       1 │ 1943.09 req/sec │  ± 0.00 % │              + 225.92 % │
[bench:run] |─────────────────────|─────────|─────────────────|───────────|─────────────────────────|
[bench:run] │ undici - request    │       1 │ 2084.66 req/sec │  ± 0.00 % │              + 249.66 % │
[bench:run] |─────────────────────|─────────|─────────────────|───────────|─────────────────────────|
[bench:run] │ undici - pipeline   │       1 │ 2142.13 req/sec │  ± 0.00 % │              + 259.30 % │
[bench:run] |─────────────────────|─────────|─────────────────|───────────|─────────────────────────|
[bench:run] │ undici - stream     │       1 │ 2847.98 req/sec │  ± 0.00 % │              + 377.69 % │
[bench:run] |─────────────────────|─────────|─────────────────|───────────|─────────────────────────|
[bench:run] │ undici - dispatch   │       1 │ 2941.40 req/sec │  ± 0.00 % │              + 393.36 % │

@codecov-commenter
Copy link

codecov-commenter commented Mar 18, 2022

Codecov Report

Merging #1291 (0847a1b) into main (fc79429) will increase coverage by 0.03%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1291      +/-   ##
==========================================
+ Coverage   94.14%   94.18%   +0.03%     
==========================================
  Files          44       44              
  Lines        4098     4126      +28     
==========================================
+ Hits         3858     3886      +28     
  Misses        240      240              
Impacted Files Coverage Δ
lib/mock/mock-agent.js 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fc79429...0847a1b. Read the comment docs.

@mcollina
Copy link
Member Author

@ShogunPanda @RafaelGSS could you take a look?

@@ -129,6 +129,8 @@ function printResults (results) {
]
})

console.log(results)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
console.log(results)

Copy link
Member Author

Choose a reason for hiding this comment

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

This is needed for debugging this and showing that it's using one sample anyway

benchmarks/benchmark.js Outdated Show resolved Hide resolved
@@ -10,7 +10,7 @@ const { WritableStream } = require('stream/web')

const { Pool, Client, fetch, Agent, setGlobalDispatcher } = require('..')

const iterations = (parseInt(process.env.SAMPLES, 10) || 100) + 1
const iterations = (parseInt(process.env.SAMPLES, 10) || 10) + 1
Copy link
Member

Choose a reason for hiding this comment

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

Why does it need to change? I have run it locally and it's working fine. When 10 it uses only 1 sample.

Copy link
Member Author

Choose a reason for hiding this comment

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

Nothing, I committed my current branch.

Co-authored-by: Rafael Silva <rafael.nunu@hotmail.com>
Copy link
Contributor

@ShogunPanda ShogunPanda left a comment

Choose a reason for hiding this comment

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

LGTM!

@ronag ronag merged commit 65763ca into main Mar 20, 2022
KhafraDev pushed a commit to KhafraDev/undici that referenced this pull request Jun 23, 2022
* partial fix for bench

* fix lint

* Update benchmarks/benchmark.js

Co-authored-by: Rafael Silva <rafael.nunu@hotmail.com>

Co-authored-by: Rafael Silva <rafael.nunu@hotmail.com>
metcoder95 pushed a commit to metcoder95/undici that referenced this pull request Dec 26, 2022
* partial fix for bench

* fix lint

* Update benchmarks/benchmark.js

Co-authored-by: Rafael Silva <rafael.nunu@hotmail.com>

Co-authored-by: Rafael Silva <rafael.nunu@hotmail.com>
@Uzlopak Uzlopak deleted the fix-bench branch February 21, 2024 12:36
crysmags pushed a commit to crysmags/undici that referenced this pull request Feb 27, 2024
* partial fix for bench

* fix lint

* Update benchmarks/benchmark.js

Co-authored-by: Rafael Silva <rafael.nunu@hotmail.com>

Co-authored-by: Rafael Silva <rafael.nunu@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants