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

Function run

benchmark/streams/iter-throughput-identity.js:37–54  ·  view source on GitHub ↗
(cb)

Source from the content-addressed store, hash-verified

35 let remaining = 0;
36
37 function run(cb) {
38 remaining = datasize;
39 const r = new Readable({
40 read() {
41 if (remaining <= 0) {
42 this.push(null);
43 return;
44 }
45 const size = Math.min(remaining, chunk.length);
46 remaining -= size;
47 this.push(size === chunk.length ? chunk : chunk.subarray(0, size));
48 },
49 });
50 const w = new Writable({
51 write(data, enc, cb) { cb(); },
52 });
53 pipeline(r, w, cb);
54 }
55
56 let i = 0;
57 bench.start();

Callers 3

benchClassicFunction · 0.70
benchWebStreamFunction · 0.70
benchIterFunction · 0.70

Calls 4

pipeToMethod · 0.95
pipeToFunction · 0.85
sourceFunction · 0.70
pipelineFunction · 0.50

Tested by

no test coverage detected