Skip to content

Commit

Permalink
benchmark: reduce code duplication
Browse files Browse the repository at this point in the history
Merge duplicate case code in child-process-params.js.

PR-URL: #36568
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
Trott authored and targos committed May 1, 2021
1 parent dcbcd9e commit 681c4af
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions benchmark/child_process/child-process-params.js
Expand Up @@ -82,6 +82,7 @@ function main({ n, methodName, params }) {
}
break;
case 'execFileSync':
case 'spawnSync':
switch (params) {
case 1:
bench.start();
Expand Down Expand Up @@ -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;
}
}

0 comments on commit 681c4af

Please sign in to comment.