-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Reduce benchmark test run time #18778
Comments
I don't believe this is correct. We set thousands to 0.001 to counteract that problem. |
@apapirovski seems like we missed to add the argument for the buffers test. That does not contain the |
@BridgeAR good eye. Should be an easy change if someone wants to make a very simple but impactful first commit. |
i would like to take this up @BridgeAR @apapirovski |
@BridgeAR can you please tell exactly which file to work on? |
So the test file is |
@BridgeAR can i put |
@juggernaut451 yes, for me it was only a way of writing the number that should be passed in. |
I would definitely prefer the consistency only using |
I would also prefer to consistently use |
@BridgeAR working on it.. |
@BridgeAR in some cases |
In that case const bench = common.createBenchmark(main, {
method: ['spread', 'assign', '_extend'],
count: [5, 10, 20],
- millions: [1]
+ n: [1e6]
});
- function main({ millions, context, count, rest, method }) {
+ function main({ n, context, count, rest, method }) {
- const n = millions * 1e6; |
thank you @AndreasMadsen :) |
In |
@juggernaut451 please always check how the variables are used. In this particular case it is that n is what we want to have. So you just have to replace millions with n and you are done. diff --git a/benchmark/process/next-tick-depth-args.js b/benchmark/process/next-tick-depth-args.js
index 1c1b95bdc8..52c6f4f431 100644
--- a/benchmark/process/next-tick-depth-args.js
+++ b/benchmark/process/next-tick-depth-args.js
@@ -2,13 +2,12 @@
const common = require('../common.js');
const bench = common.createBenchmark(main, {
- millions: [12]
+ n: [12e6]
});
process.maxTickDepth = Infinity;
-function main({ millions }) {
- var n = millions * 1e6;
+function main({ n }) {
function cb4(arg1, arg2, arg3, arg4) {
if (--n) {
@@ -21,7 +20,7 @@ function main({ millions }) {
else
process.nextTick(cb1, 0);
} else
- bench.end(millions);
+ bench.end(n);
}
function cb3(arg1, arg2, arg3) {
if (--n) {
@@ -34,7 +33,7 @@ function main({ millions }) {
else
process.nextTick(cb1, 0);
} else
- bench.end(millions);
+ bench.end(n);
}
function cb2(arg1, arg2) {
if (--n) {
@@ -47,7 +46,7 @@ function main({ millions }) {
else
process.nextTick(cb1, 0);
} else
- bench.end(millions);
+ bench.end(n);
}
function cb1(arg1) {
if (--n) {
@@ -60,7 +59,7 @@ function main({ millions }) {
else
process.nextTick(cb1, 0);
} else
- bench.end(millions);
+ bench.end(n);
}
bench.start();
process.nextTick(cb1, true); |
ok thanks was just confirming so that things don't mess up |
@BridgeAR |
ignore the last comment. Figured out the solution |
I have raised the pull request. Please review it |
PR-URL: #18917 Fixes: #18778 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Andreas Madsen <amwebdk@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Right now our benchmarks often contain
millions
orthousands
as iteration step. This should be changed ton
(in case of a conflict e.g.iterations
) where the concrete number is given.This allows our tests to significantly run faster, since the minimum iteration will not be a million times but a single time. The corresponding benchmark tests should be changed as well therefore.Another benefit of it is that it is easier to read how fast the operation really was.
It would be great if a PR would change all entries at once or all entries of a subsystem to prevent conflicting changes. If someone starts working on this, please leave a note when you do so and on what you work so others know.
As soon as the benchmarks and the tests get fixed there would be a follow up task to check how long each individual sequential benchmark tests takes that was changed and if it would be possible to move them from sequential to parallel.I will gladly assist as a mentor in case help is needed.
Update: I "removed the parts that do not apply anymore. The rest is still up to date and open.
The text was updated successfully, but these errors were encountered: