MCPcopy Create free account
hub / github.com/nodejs/node / main

Function main

benchmark/streams/iter-throughput-pipeto.js:18–34  ·  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);
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-source':
30 return benchIterSyncSource(chunk, datasize, n, totalOps);
31 case 'iter-sync':
32 return benchIterSync(chunk, datasize, n, totalOps);
33 }
34}
35
36function benchClassic(chunk, datasize, n, totalOps) {
37 function run(cb) {

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected