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

Function main

benchmark/domain/domain-fn-args.js:13–29  ·  view source on GitHub ↗
({ n, args })

Source from the content-addressed store, hash-verified

11const gargs = [1, 2, 3];
12
13function main({ n, args }) {
14 const myArguments = gargs.slice(0, args);
15 bench.start();
16
17 bdomain.enter();
18 for (let i = 0; i < n; i++) {
19 if (myArguments.length >= 2) {
20 const args = Array.prototype.slice.call(myArguments, 1);
21 fn.apply(this, args);
22 } else {
23 fn.call(this);
24 }
25 }
26 bdomain.exit();
27
28 bench.end(n);
29}
30
31function fn(a = 1, b = 2, c = 3) {
32 return a + b + c;

Callers

nothing calls this directly

Calls 7

sliceMethod · 0.65
startMethod · 0.45
enterMethod · 0.45
callMethod · 0.45
applyMethod · 0.45
exitMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected