(cb)
| 32 | |
| 33 | function benchClassic(chunk, datasize, n, totalOps) { |
| 34 | function run(cb) { |
| 35 | let remaining = datasize; |
| 36 | const r = new Readable({ |
| 37 | read() { |
| 38 | if (remaining <= 0) { this.push(null); return; } |
| 39 | const size = Math.min(remaining, chunk.length); |
| 40 | remaining -= size; |
| 41 | this.push(size === chunk.length ? chunk : chunk.subarray(0, size)); |
| 42 | }, |
| 43 | }); |
| 44 | const w = new Writable({ write(data, enc, cb) { cb(); } }); |
| 45 | pipeline(r, zlib.createGzip(), zlib.createGunzip(), w, cb); |
| 46 | } |
| 47 | |
| 48 | let i = 0; |
| 49 | bench.start(); |
no test coverage detected