MCPcopy Index your code
hub / github.com/nodejs/node / main

Function main

benchmark/streams/pipe.js:10–24  ·  view source on GitHub ↗
({ n })

Source from the content-addressed store, hash-verified

8});
9
10function main({ n }) {
11 const b = Buffer.alloc(1024);
12 const r = new Readable();
13 const w = new Writable();
14
15 let i = 0;
16
17 r._read = () => r.push(i++ === n ? null : b);
18 w._write = (data, enc, cb) => cb();
19
20 bench.start();
21
22 r.pipe(w);
23 w.on('finish', () => bench.end(n));
24}

Callers

nothing calls this directly

Calls 6

allocMethod · 0.80
cbFunction · 0.50
pushMethod · 0.45
startMethod · 0.45
onMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…