diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2017-12-30 03:55:00 +0100 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2018-01-23 01:29:16 +0100 |
commit | 5dfb93d2fa70b5e236495ea4045e384b8fb84122 (patch) | |
tree | 8ef49cf19feb25ac45c9116bd9fe1e43031f9d4f /benchmark/zlib | |
parent | 49f5e0818842740770fef1b25bca30c6dc826841 (diff) | |
download | android-node-v8-5dfb93d2fa70b5e236495ea4045e384b8fb84122.tar.gz android-node-v8-5dfb93d2fa70b5e236495ea4045e384b8fb84122.tar.bz2 android-node-v8-5dfb93d2fa70b5e236495ea4045e384b8fb84122.zip |
benchmark: (zlib) use destructuring
PR-URL: https://github.com/nodejs/node/pull/18250
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'benchmark/zlib')
-rw-r--r-- | benchmark/zlib/creation.js | 7 | ||||
-rw-r--r-- | benchmark/zlib/deflate.js | 6 |
2 files changed, 5 insertions, 8 deletions
diff --git a/benchmark/zlib/creation.js b/benchmark/zlib/creation.js index 5046ef50ec..4984bf1a86 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 00993b6446..5e86d65980 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) { |