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

Function main

benchmark/zlib/createInflate.js:11–32  ·  view source on GitHub ↗
({ n, inputLen, chunkLen })

Source from the content-addressed store, hash-verified

9});
10
11function main({ n, inputLen, chunkLen }) {
12 const input = zlib.deflateSync(Buffer.alloc(inputLen, 'a'));
13
14 let i = 0;
15 bench.start();
16 (function next() {
17 let p = 0;
18 const inflater = zlib.createInflate();
19 inflater.resume();
20 inflater.on('finish', () => {
21 if (i++ === n)
22 return bench.end(n);
23 next();
24 });
25
26 (function nextChunk() {
27 if (p >= input.length)
28 return inflater.end();
29 inflater.write(input.slice(p, p += chunkLen), nextChunk);
30 })();
31 })();
32}

Callers

nothing calls this directly

Calls 8

allocMethod · 0.80
resumeMethod · 0.65
sliceMethod · 0.65
nextFunction · 0.50
startMethod · 0.45
onMethod · 0.45
endMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…