Skip to content

Commit

Permalink
test: reduce run time for misc benchmark tests
Browse files Browse the repository at this point in the history
Run only one benchmark for each benchmark file tested by
test-benchmark-misc.js.

PR-URL: #16120
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
  • Loading branch information
Trott authored and targos committed Oct 18, 2017
1 parent b0b224c commit 9808c59
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions benchmark/misc/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ function runUsingArgumentsAndApply(n, concat) {
function main(conf) {
const n = +conf.n;
switch (conf.method) {
// '' is a default case for tests
case '':
case 'restAndSpread':
runUsingRestAndSpread(n, conf.concat);
break;
Expand Down
2 changes: 2 additions & 0 deletions benchmark/misc/object-property-bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ function main(conf) {
const n = +conf.millions * 1e6;

switch (conf.method) {
// '' is a default case for tests
case '':
case 'property':
runProperty(n);
break;
Expand Down
2 changes: 2 additions & 0 deletions benchmark/misc/punycode.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ function main(conf) {
const n = +conf.n;
const val = conf.val;
switch (conf.method) {
// '' is a default case for tests
case '':
case 'punycode':
runPunycode(n, val);
break;
Expand Down
7 changes: 4 additions & 3 deletions test/parallel/test-benchmark-misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ require('../common');
const runBenchmark = require('../common/benchmark');

runBenchmark('misc', [
'n=1',
'val=magyarország.icom.museum',
'concat=0',
'method=',
'millions=.000001',
'n=1',
'type=extend',
'concat=0'
'val=magyarország.icom.museum'
]);

0 comments on commit 9808c59

Please sign in to comment.