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 Dec 21, 2020
1 parent bbc0d14 commit e1f00fd
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions benchmark/child_process/child-process-params.js
Original file line number Diff line number Diff line change
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 e1f00fd

Please sign in to comment.