diff --git a/benchmark/util/normalize-encoding.js b/benchmark/util/normalize-encoding.js index 2cdfd54442114d..96eab1912d0761 100644 --- a/benchmark/util/normalize-encoding.js +++ b/benchmark/util/normalize-encoding.js @@ -47,11 +47,9 @@ function getInput(input) { } } -function main(conf) { - const normalizeEncoding = require('internal/util').normalizeEncoding; - - const n = conf.n | 0; - const inputs = getInput(conf.input); +function main({ input, n }) { + const { normalizeEncoding } = require('internal/util'); + const inputs = getInput(input); var noDead = ''; bench.start(); diff --git a/benchmark/util/type-check.js b/benchmark/util/type-check.js index ee8dd7e4ece188..e1d1ac553fedcf 100644 --- a/benchmark/util/type-check.js +++ b/benchmark/util/type-check.js @@ -34,16 +34,15 @@ const bench = common.createBenchmark(main, { flags: ['--expose-internals'] }); -function main(conf) { +function main({ type, argument, version, n }) { // For testing, if supplied with an empty type, default to ArrayBufferView. - conf.type = conf.type || 'ArrayBufferView'; + type = type || 'ArrayBufferView'; const util = process.binding('util'); const types = require('internal/util/types'); - const n = (+conf.n) | 0; - const func = { native: util, js: types }[conf.version][`is${conf.type}`]; - const arg = args[conf.type][conf.argument]; + const func = { native: util, js: types }[version][`is${type}`]; + const arg = args[type][argument]; bench.start(); for (var i = 0; i < n; i++) { diff --git a/benchmark/v8/get-stats.js b/benchmark/v8/get-stats.js index 96de7572397161..6ee742858629c2 100644 --- a/benchmark/v8/get-stats.js +++ b/benchmark/v8/get-stats.js @@ -11,9 +11,7 @@ const bench = common.createBenchmark(main, { n: [1e6] }); -function main(conf) { - const n = +conf.n; - const method = conf.method; +function main({ method, n }) { var i = 0; bench.start(); for (; i < n; i++) diff --git a/benchmark/vm/run-in-context.js b/benchmark/vm/run-in-context.js index 6e26a6d0ebeb38..da8f56a6e0153b 100644 --- a/benchmark/vm/run-in-context.js +++ b/benchmark/vm/run-in-context.js @@ -10,10 +10,8 @@ const bench = common.createBenchmark(main, { const vm = require('vm'); -function main(conf) { - const n = +conf.n; - const options = conf.breakOnSigint ? { breakOnSigint: true } : {}; - const withSigintListener = !!conf.withSigintListener; +function main({ n, breakOnSigint, withSigintListener }) { + const options = breakOnSigint ? { breakOnSigint: true } : {}; process.removeAllListeners('SIGINT'); if (withSigintListener) diff --git a/benchmark/vm/run-in-this-context.js b/benchmark/vm/run-in-this-context.js index a0c737f46954f1..33fd3a34d81f8f 100644 --- a/benchmark/vm/run-in-this-context.js +++ b/benchmark/vm/run-in-this-context.js @@ -10,10 +10,8 @@ const bench = common.createBenchmark(main, { const vm = require('vm'); -function main(conf) { - const n = +conf.n; - const options = conf.breakOnSigint ? { breakOnSigint: true } : {}; - const withSigintListener = !!conf.withSigintListener; +function main({ n, breakOnSigint, withSigintListener }) { + const options = breakOnSigint ? { breakOnSigint: true } : {}; process.removeAllListeners('SIGINT'); if (withSigintListener)