({ n, inputLen, chunkLen })
| 9 | }); |
| 10 | |
| 11 | function main({ n, inputLen, chunkLen }) { |
| 12 | const input = zlib.deflateSync(Buffer.alloc(inputLen, 'a')); |
| 13 | |
| 14 | let i = 0; |
| 15 | bench.start(); |
| 16 | (function next() { |
| 17 | let p = 0; |
| 18 | const inflater = zlib.createInflate(); |
| 19 | inflater.resume(); |
| 20 | inflater.on('finish', () => { |
| 21 | if (i++ === n) |
| 22 | return bench.end(n); |
| 23 | next(); |
| 24 | }); |
| 25 | |
| 26 | (function nextChunk() { |
| 27 | if (p >= input.length) |
| 28 | return inflater.end(); |
| 29 | inflater.write(input.slice(p, p += chunkLen), nextChunk); |
| 30 | })(); |
| 31 | })(); |
| 32 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…