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

Function main

benchmark/esm/require-esm.js:49–79  ·  view source on GitHub ↗
({ n, exports, type })

Source from the content-addressed store, hash-verified

47}
48
49function main({ n, exports, type }) {
50 const script = prepare(n, exports === 'default');
51 switch (type) {
52 case 'all': {
53 bench.start();
54 const result = require(script).access();
55 bench.end(n);
56 assert.strictEqual(result, n);
57 break;
58 }
59 case 'access': {
60 const { access } = require(script);
61 bench.start();
62 let result = access();
63 for (let i = 0; i < 99; ++i) {
64 result = access();
65 }
66 bench.end(n * 100);
67 assert.strictEqual(result, n);
68 break;
69 }
70 case 'load': {
71 bench.start();
72 const { access } = require(script);
73 bench.end(n);
74 const result = access();
75 assert.strictEqual(result, n);
76 break;
77 }
78 }
79}

Callers

nothing calls this directly

Calls 6

prepareFunction · 0.70
requireFunction · 0.50
accessFunction · 0.50
startMethod · 0.45
accessMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…