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

Function main

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected