diff --git a/benchmark/zlib/creation.js b/benchmark/zlib/creation.js index 5046ef50ecff06..4984bf1a86b755 100644 --- a/benchmark/zlib/creation.js +++ b/benchmark/zlib/creation.js @@ -10,14 +10,13 @@ const bench = common.createBenchmark(main, { n: [5e5] }); -function main(conf) { - const n = +conf.n; - const fn = zlib[`create${conf.type}`]; +function main({ n, type, options }) { + const fn = zlib[`create${type}`]; if (typeof fn !== 'function') throw new Error('Invalid zlib type'); var i = 0; - if (conf.options === 'true') { + if (options === 'true') { const opts = {}; bench.start(); for (; i < n; ++i) diff --git a/benchmark/zlib/deflate.js b/benchmark/zlib/deflate.js index 00993b64462539..5e86d659803747 100644 --- a/benchmark/zlib/deflate.js +++ b/benchmark/zlib/deflate.js @@ -8,10 +8,8 @@ const bench = common.createBenchmark(main, { n: [4e5] }); -function main(conf) { - const n = +conf.n; - const method = conf.method; - const chunk = Buffer.alloc(+conf.inputLen, 'a'); +function main({ n, method, inputLen }) { + const chunk = Buffer.alloc(inputLen, 'a'); var i = 0; switch (method) {