-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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, test: test the HTTP benchmark with a dummy benchmarker #12121
Conversation
/cc @Trott @nodejs/benchmarking @nodejs/build |
It's timing out on pi1-raspbian-wheezy..should we skip this test on these slower devices, or set a larger timeout for them? (not sure how to do this) |
There is also another way to fix the timeout: test the benchmarks one by one in multiple tests using |
Love it! I'd be OK with "fixing" the Pi timing out problem by not running this test on Pi. Since it's just the Pi 1 that is failing you can do this: if (!common.enoughTestMem) {
common.skip('Insufficient memory for HTTP benchmark test');
return;
} |
benchmark/_dummy-benchmarker.js
Outdated
@@ -0,0 +1,7 @@ | |||
'use strict'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not intending to be pedantic... but can we use _noop-benchmarker
(noop for non-operational) instead of _dummy-...
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like noop
because noop
means "no operator". A noop
should do nothing whatsoever. But that's not the case here.
In this case, this is a test double, so _test-double-benchmarker
maybe? Sometimes people call certain types of test doubles mocks
and other types stubs
, so mock-benchmarker
or stub-benchmarker
might also be appropriate. (I stick to test double
so that I don't have to worry about whether or not something is a mock or a stub.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I'm fine with whatever name because this is an internal thing and we can always change it later. So if @jasnell or someone else disagrees with my suggestions,
¯\(ツ)/¯.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it's not really a noop since it does connects to the server (a real noop-benchmarker
would just skip the http.get
call and write to stdout straight away). I think _test-double-benchmarker
is better :D
num: [1, 4, 8, 16], | ||
size: [1, 64, 256], | ||
n: [1, 4, 8, 16], | ||
len: [1, 64, 256], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why change these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So test-benchmark-http.js can set the parameters for it (otherwise it will need to add --set num=1 --set size=1
...also I think it's better to keep the configuration names consistent)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also if we want to do #12068, doing this to other benchmarks too will make it eaiser..
Renamed New CI: https://ci.nodejs.org/job/node-test-pull-request/7150/ |
node-test-commit-osx took 2h30m to run..although it doesn' seem to be related to this PR since https://ci.nodejs.org/job/node-test-commit-osx/8734/ and https://ci.nodejs.org/job/node-test-commit/8819/ took more than 2 hours too? |
Launch a osx CI against this one: https://ci.nodejs.org/job/node-test-commit-osx/8737/ |
I think you meant to rename it |
It's double now, thanks for catching that @vsemozhetbyt @Trott :D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM if CI is green
@jasnell Is @joyeecheung's answer to your question "why change the config property names" sufficient? If so can you update your review so this can be unblocked? @joyeecheung Can you rebase? (I'd really like to see this land. :-D ) |
Yes. It's fine. I can't clear my review from the mobile view. This lgtm |
Refactor benchmark/_http-benchmarkers.js and add a dummy HTTP benchmarker for testing.
Rebased. New CI: https://ci.nodejs.org/job/node-test-pull-request/7277/ |
CI failures are unrelated. LGTM. |
Landed in c095394...2d3d4cc, thanks! |
cc @joyeecheung |
Some of the changes depend on #10558, but should still be backportable. Doing a backport now... |
Refactor benchmark/_http-benchmarkers.js and add a test double HTTP benchmarker for testing. PR-URL: nodejs#12121 Refs: nodejs#12068
PR-URL: nodejs#12121 Refs: nodejs#12068
@joyeecheung do you think it makes sense to backport this to Node 6? |
@gibfahn The new benchmark suite does not exist in 6.x so it can not be backported. |
This is a retake of #12025, it basically just goes with the last option in #12025 (comment), makes a dummy http benchmarker to connect to the benchmarked http server once, and sets all the numeric benchmark configurations to the minimal.
_http-benchmarks
a bit to use ES6 classes.http/_http_simple.js
tofixtures/simple-http-server.js
since it is not a benchmark itselfThis adds about 10s to the test running time on my mac (i7-4770HQ CPU @ 2.20GHz) (as comparison,
test-benchmark-net.js
runs for about 5s)Refs: #12068
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test, benchmark