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

Function main

benchmark/child_process/child-process-exec-maxbuffer.js:16–39  ·  view source on GitHub ↗
({ n, chunks })

Source from the content-addressed store, hash-verified

14});
15
16function main({ n, chunks }) {
17 const script =
18 'const b = Buffer.alloc(65536, 0x61);' +
19 `for (let i = 0; i < ${chunks}; i++) process.stdout.write(b);`;
20 const args = ['-e', script];
21 const options = {
22 maxBuffer: chunks * 65536 + 65536,
23 encoding: 'buffer',
24 };
25
26 let left = n;
27 const run = () => {
28 execFile(process.execPath, args, options, (err) => {
29 if (err)
30 throw err;
31 if (--left === 0)
32 return bench.end(n);
33 run();
34 });
35 };
36
37 bench.start();
38 run();
39}

Callers

nothing calls this directly

Calls 2

runFunction · 0.70
startMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…