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

Function main

benchmark/streams/iter-throughput-identity.js:18–32  ·  view source on GitHub ↗
({ api, datasize, n })

Source from the content-addressed store, hash-verified

16const CHUNK_SIZE = 64 * 1024;
17
18function main({ api, datasize, n }) {
19 const chunk = Buffer.alloc(CHUNK_SIZE, 'abcdefghij');
20 const totalOps = (datasize * n) / (1024 * 1024); // MB
21
22 switch (api) {
23 case 'classic':
24 return benchClassic(chunk, datasize, n, totalOps);
25 case 'webstream':
26 return benchWebStream(chunk, datasize, n, totalOps);
27 case 'iter':
28 return benchIter(chunk, datasize, n, totalOps);
29 case 'iter-sync':
30 return benchIterSync(chunk, datasize, n, totalOps);
31 }
32}
33
34function benchClassic(chunk, datasize, n, totalOps) {
35 let remaining = 0;

Callers

nothing calls this directly

Calls 5

allocMethod · 0.80
benchClassicFunction · 0.70
benchWebStreamFunction · 0.70
benchIterFunction · 0.70
benchIterSyncFunction · 0.70

Tested by

no test coverage detected