(cb)
| 40 | |
| 41 | function benchClassic(chunk, datasize, n, totalOps) { |
| 42 | function run(cb) { |
| 43 | let remaining = datasize; |
| 44 | const r = new Readable({ |
| 45 | read() { |
| 46 | if (remaining <= 0) { this.push(null); return; } |
| 47 | const size = Math.min(remaining, chunk.length); |
| 48 | remaining -= size; |
| 49 | this.push(size === chunk.length ? chunk : chunk.subarray(0, size)); |
| 50 | }, |
| 51 | }); |
| 52 | const t = new Transform({ |
| 53 | transform(data, enc, cb) { |
| 54 | cb(null, copyBuf(data)); |
| 55 | }, |
| 56 | }); |
| 57 | const w = new Writable({ write(data, enc, cb) { cb(); } }); |
| 58 | pipeline(r, t, w, cb); |
| 59 | } |
| 60 | |
| 61 | let i = 0; |
| 62 | bench.start(); |
no test coverage detected