diff --git a/benchmark/streams/readable-bigread.js b/benchmark/streams/readable-bigread.js index 34d478fb478478..99213afaeb8f28 100644 --- a/benchmark/streams/readable-bigread.js +++ b/benchmark/streams/readable-bigread.js @@ -7,8 +7,7 @@ const bench = common.createBenchmark(main, { n: [100e1] }); -function main(conf) { - const n = +conf.n; +function main({ n }) { const b = new Buffer(32); const s = new Readable(); function noop() {} diff --git a/benchmark/streams/readable-bigunevenread.js b/benchmark/streams/readable-bigunevenread.js index d176166ae4f432..e2f2c1406a1da0 100644 --- a/benchmark/streams/readable-bigunevenread.js +++ b/benchmark/streams/readable-bigunevenread.js @@ -7,8 +7,7 @@ const bench = common.createBenchmark(main, { n: [100e1] }); -function main(conf) { - const n = +conf.n; +function main({ n }) { const b = new Buffer(32); const s = new Readable(); function noop() {} diff --git a/benchmark/streams/readable-boundaryread.js b/benchmark/streams/readable-boundaryread.js index 4834da0a2c5bf8..835c7d18b51285 100644 --- a/benchmark/streams/readable-boundaryread.js +++ b/benchmark/streams/readable-boundaryread.js @@ -8,11 +8,10 @@ const bench = common.createBenchmark(main, { type: ['string', 'buffer'] }); -function main(conf) { - const n = +conf.n; +function main({ n, type }) { const s = new Readable(); var data = 'a'.repeat(32); - if (conf.type === 'buffer') + if (type === 'buffer') data = Buffer.from(data); s._read = function() {}; diff --git a/benchmark/streams/readable-readall.js b/benchmark/streams/readable-readall.js index be34afbeabc090..5715e42017c795 100644 --- a/benchmark/streams/readable-readall.js +++ b/benchmark/streams/readable-readall.js @@ -7,8 +7,7 @@ const bench = common.createBenchmark(main, { n: [50e2] }); -function main(conf) { - const n = +conf.n; +function main({ n }) { const b = new Buffer(32); const s = new Readable(); function noop() {} diff --git a/benchmark/streams/readable-unevenread.js b/benchmark/streams/readable-unevenread.js index ebbc727ad23ec3..d7a408b1c56a31 100644 --- a/benchmark/streams/readable-unevenread.js +++ b/benchmark/streams/readable-unevenread.js @@ -7,8 +7,7 @@ const bench = common.createBenchmark(main, { n: [100e1] }); -function main(conf) { - const n = +conf.n; +function main({ n }) { const b = new Buffer(32); const s = new Readable(); function noop() {} diff --git a/benchmark/streams/transform-creation.js b/benchmark/streams/transform-creation.js index bd5ac96fa71e32..abfab0c8e25321 100644 --- a/benchmark/streams/transform-creation.js +++ b/benchmark/streams/transform-creation.js @@ -13,9 +13,7 @@ function MyTransform() { inherits(MyTransform, Transform); MyTransform.prototype._transform = function() {}; -function main(conf) { - const n = +conf.n; - +function main({ n }) { bench.start(); for (var i = 0; i < n; ++i) new MyTransform(); diff --git a/benchmark/streams/writable-manywrites.js b/benchmark/streams/writable-manywrites.js index fadafe86e4cf70..6fcb07e849d615 100644 --- a/benchmark/streams/writable-manywrites.js +++ b/benchmark/streams/writable-manywrites.js @@ -7,8 +7,7 @@ const bench = common.createBenchmark(main, { n: [2e6] }); -function main(conf) { - const n = +conf.n; +function main({ n }) { const b = Buffer.allocUnsafe(1024); const s = new Writable(); s._write = function(chunk, encoding, cb) {