mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
benchmark: reduce code duplication
Merge duplicate case code in child-process-params.js. PR-URL: https://github.com/nodejs/node/pull/36568 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
parent
2070d5b524
commit
fee3b89a2b
@ -82,6 +82,7 @@ function main({ n, methodName, params }) {
|
||||
}
|
||||
break;
|
||||
case 'execFileSync':
|
||||
case 'spawnSync':
|
||||
switch (params) {
|
||||
case 1:
|
||||
bench.start();
|
||||
@ -119,24 +120,5 @@ function main({ n, methodName, params }) {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'spawnSync':
|
||||
switch (params) {
|
||||
case 1:
|
||||
bench.start();
|
||||
for (let i = 0; i < n; i++) method(command);
|
||||
bench.end(n);
|
||||
break;
|
||||
case 2:
|
||||
bench.start();
|
||||
for (let i = 0; i < n; i++) method(command, args);
|
||||
bench.end(n);
|
||||
break;
|
||||
case 3:
|
||||
bench.start();
|
||||
for (let i = 0; i < n; i++) method(command, args, options);
|
||||
bench.end(n);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user