From 60458f48257fba2eaccfc5179105445a3552cfc2 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 9 Oct 2017 23:56:21 -0700 Subject: [PATCH] test: reduce run time for misc benchmark tests Run only one benchmark for each benchmark file tested by test-benchmark-misc.js. PR-URL: https://github.com/nodejs/node/pull/16120 Reviewed-By: Daijiro Wachi Reviewed-By: Franziska Hinkelmann --- benchmark/misc/console.js | 2 ++ benchmark/misc/object-property-bench.js | 2 ++ benchmark/misc/punycode.js | 2 ++ test/parallel/test-benchmark-misc.js | 7 ++++--- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/benchmark/misc/console.js b/benchmark/misc/console.js index 8e9fbd8c54..ab938168ac 100644 --- a/benchmark/misc/console.js +++ b/benchmark/misc/console.js @@ -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; diff --git a/benchmark/misc/object-property-bench.js b/benchmark/misc/object-property-bench.js index 8ac7683cd5..d6afd4e9c0 100644 --- a/benchmark/misc/object-property-bench.js +++ b/benchmark/misc/object-property-bench.js @@ -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; diff --git a/benchmark/misc/punycode.js b/benchmark/misc/punycode.js index 74ddadbb9d..630aea3195 100644 --- a/benchmark/misc/punycode.js +++ b/benchmark/misc/punycode.js @@ -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; diff --git a/test/parallel/test-benchmark-misc.js b/test/parallel/test-benchmark-misc.js index cda74f1693..df3bae4706 100644 --- a/test/parallel/test-benchmark-misc.js +++ b/test/parallel/test-benchmark-misc.js @@ -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' ]);