diff --git a/benchmark/process/bench-env.js b/benchmark/process/bench-env.js index 66f966f587bb7f..a332d3cbd61895 100644 --- a/benchmark/process/bench-env.js +++ b/benchmark/process/bench-env.js @@ -7,8 +7,7 @@ const bench = common.createBenchmark(main, { }); -function main(conf) { - const n = conf.n >>> 0; +function main({ n }) { bench.start(); for (var i = 0; i < n; i++) { // Access every item in object to process values. diff --git a/benchmark/process/bench-hrtime.js b/benchmark/process/bench-hrtime.js index 8a2920a238d042..9152a32b22d213 100644 --- a/benchmark/process/bench-hrtime.js +++ b/benchmark/process/bench-hrtime.js @@ -8,13 +8,12 @@ const bench = common.createBenchmark(main, { type: ['raw', 'diff'] }); -function main(conf) { - const n = conf.n | 0; +function main({ n, type }) { const hrtime = process.hrtime; var noDead = hrtime(); var i; - if (conf.type === 'raw') { + if (type === 'raw') { bench.start(); for (i = 0; i < n; i++) { noDead = hrtime(); diff --git a/benchmark/process/memoryUsage.js b/benchmark/process/memoryUsage.js index 8b5aea871819ef..f9b969ab885d8b 100644 --- a/benchmark/process/memoryUsage.js +++ b/benchmark/process/memoryUsage.js @@ -5,9 +5,7 @@ const bench = common.createBenchmark(main, { n: [1e5] }); -function main(conf) { - const n = +conf.n; - +function main({ n }) { bench.start(); for (var i = 0; i < n; i++) { process.memoryUsage(); diff --git a/benchmark/process/next-tick-breadth-args.js b/benchmark/process/next-tick-breadth-args.js index ca608f15daa743..d759b955c429fe 100644 --- a/benchmark/process/next-tick-breadth-args.js +++ b/benchmark/process/next-tick-breadth-args.js @@ -5,8 +5,8 @@ const bench = common.createBenchmark(main, { millions: [4] }); -function main(conf) { - const N = +conf.millions * 1e6; +function main({ millions }) { + const N = millions * 1e6; var n = 0; function cb1(arg1) { diff --git a/benchmark/process/next-tick-breadth.js b/benchmark/process/next-tick-breadth.js index 51951ce0afd645..aebd623869b577 100644 --- a/benchmark/process/next-tick-breadth.js +++ b/benchmark/process/next-tick-breadth.js @@ -5,8 +5,8 @@ const bench = common.createBenchmark(main, { millions: [4] }); -function main(conf) { - const N = +conf.millions * 1e6; +function main({ millions }) { + const N = millions * 1e6; var n = 0; function cb() { diff --git a/benchmark/process/next-tick-depth-args.js b/benchmark/process/next-tick-depth-args.js index de792b303cca23..1c1b95bdc84bd1 100644 --- a/benchmark/process/next-tick-depth-args.js +++ b/benchmark/process/next-tick-depth-args.js @@ -7,8 +7,8 @@ const bench = common.createBenchmark(main, { process.maxTickDepth = Infinity; -function main(conf) { - var n = +conf.millions * 1e6; +function main({ millions }) { + var n = millions * 1e6; function cb4(arg1, arg2, arg3, arg4) { if (--n) { @@ -21,7 +21,7 @@ function main(conf) { else process.nextTick(cb1, 0); } else - bench.end(+conf.millions); + bench.end(millions); } function cb3(arg1, arg2, arg3) { if (--n) { @@ -34,7 +34,7 @@ function main(conf) { else process.nextTick(cb1, 0); } else - bench.end(+conf.millions); + bench.end(millions); } function cb2(arg1, arg2) { if (--n) { @@ -47,7 +47,7 @@ function main(conf) { else process.nextTick(cb1, 0); } else - bench.end(+conf.millions); + bench.end(millions); } function cb1(arg1) { if (--n) { @@ -60,7 +60,7 @@ function main(conf) { else process.nextTick(cb1, 0); } else - bench.end(+conf.millions); + bench.end(millions); } bench.start(); process.nextTick(cb1, true); diff --git a/benchmark/process/next-tick-depth.js b/benchmark/process/next-tick-depth.js index e11beb4d0b1f31..99fc83c3772276 100644 --- a/benchmark/process/next-tick-depth.js +++ b/benchmark/process/next-tick-depth.js @@ -6,8 +6,8 @@ const bench = common.createBenchmark(main, { process.maxTickDepth = Infinity; -function main(conf) { - var n = +conf.millions * 1e6; +function main({ millions }) { + var n = millions * 1e6; bench.start(); process.nextTick(onNextTick); @@ -15,6 +15,6 @@ function main(conf) { if (--n) process.nextTick(onNextTick); else - bench.end(+conf.millions); + bench.end(millions); } } diff --git a/benchmark/process/next-tick-exec-args.js b/benchmark/process/next-tick-exec-args.js index 5ff017bb29cd5b..9e8ff73838460a 100644 --- a/benchmark/process/next-tick-exec-args.js +++ b/benchmark/process/next-tick-exec-args.js @@ -4,8 +4,8 @@ const bench = common.createBenchmark(main, { millions: [5] }); -function main(conf) { - var n = +conf.millions * 1e6; +function main({ millions }) { + var n = millions * 1e6; bench.start(); for (var i = 0; i < n; i++) { @@ -20,6 +20,6 @@ function main(conf) { } function onNextTick(i) { if (i + 1 === n) - bench.end(+conf.millions); + bench.end(millions); } } diff --git a/benchmark/process/next-tick-exec.js b/benchmark/process/next-tick-exec.js index 12c9d4624a903c..a8897cd7456476 100644 --- a/benchmark/process/next-tick-exec.js +++ b/benchmark/process/next-tick-exec.js @@ -4,8 +4,8 @@ const bench = common.createBenchmark(main, { millions: [5] }); -function main(conf) { - var n = +conf.millions * 1e6; +function main({ millions }) { + var n = millions * 1e6; bench.start(); for (var i = 0; i < n; i++) { @@ -13,6 +13,6 @@ function main(conf) { } function onNextTick(i) { if (i + 1 === n) - bench.end(+conf.millions); + bench.end(millions); } }