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

Function run

benchmark/streams/compose.js:69–96  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

67 bench.start();
68
69 function run() {
70 if (i++ === n) {
71 bench.end(n * chunks);
72 return;
73 }
74
75 const passThroughs = [];
76 for (let i = 0; i < numberOfPassThroughs; i++) {
77 passThroughs.push(new PassThrough());
78 }
79
80 let remaining = chunks;
81 const composed = compose(...passThroughs);
82 composed.on('data', () => {});
83 composed.on('end', run);
84
85 write();
86
87 function write() {
88 while (remaining-- > 0) {
89 if (!composed.write(chunk)) {
90 composed.once('drain', write);
91 return;
92 }
93 }
94 composed.end();
95 }
96 }
97
98 run();
99}

Callers 1

benchThroughputFunction · 0.70

Calls 5

composeFunction · 0.85
writeFunction · 0.70
endMethod · 0.45
pushMethod · 0.45
onMethod · 0.45

Tested by

no test coverage detected