diff options
Diffstat (limited to 'deps/node/benchmark/zlib/creation.js')
-rw-r--r-- | deps/node/benchmark/zlib/creation.js | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/deps/node/benchmark/zlib/creation.js b/deps/node/benchmark/zlib/creation.js deleted file mode 100644 index 30e6afe6..00000000 --- a/deps/node/benchmark/zlib/creation.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; -const common = require('../common.js'); -const zlib = require('zlib'); - -const bench = common.createBenchmark(main, { - type: [ - 'Deflate', 'DeflateRaw', 'Inflate', 'InflateRaw', 'Gzip', 'Gunzip', 'Unzip', - 'BrotliCompress', 'BrotliDecompress', - ], - options: ['true', 'false'], - n: [5e5] -}); - -function main({ n, type, options }) { - const fn = zlib[`create${type}`]; - if (typeof fn !== 'function') - throw new Error('Invalid zlib type'); - var i = 0; - - if (options === 'true') { - const opts = {}; - bench.start(); - for (; i < n; ++i) - fn(opts); - bench.end(n); - } else { - bench.start(); - for (; i < n; ++i) - fn(); - bench.end(n); - } -} |