Skip to content

Commit

Permalink
squash: arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Trott committed Oct 28, 2017
1 parent 7befb1c commit 78ebc37
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
3 changes: 3 additions & 0 deletions benchmark/util/format.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ const bench = common.createBenchmark(main, {
});

function main({ n, type }) {
// For testing, if supplied with an empty type, default to string.
type = type || 'string';

const [first, second] = inputs[type];

bench.start();
Expand Down
3 changes: 3 additions & 0 deletions benchmark/util/inspect-array.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ function main({ n, len, type }) {
var arr = Array(len);
var i, opts;

// For testing, if supplied with an empty type, default to denseArray.
type = type || 'denseArray';

switch (type) {
case 'denseArray_showHidden':
opts = { showHidden: true };
Expand Down
3 changes: 3 additions & 0 deletions benchmark/util/type-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ const bench = common.createBenchmark(main, {
});

function main(conf) {
// For testing, if supplied with an empty type, default to ArrayBufferView.
conf.type = conf.type || 'ArrayBufferView';

const util = process.binding('util');
const types = require('internal/util/types');

Expand Down
9 changes: 8 additions & 1 deletion test/parallel/test-benchmark-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,11 @@ require('../common');

const runBenchmark = require('../common/benchmark');

runBenchmark('util', ['n=1']);
runBenchmark('util',
['argument=false',
'input=',
'method=Array',
'n=1',
'option=none',
'type=',
'version=native']);

0 comments on commit 78ebc37

Please sign in to comment.