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

Function main

benchmark/esm/import-cjs.js:25–41  ·  view source on GitHub ↗
({ type })

Source from the content-addressed store, hash-verified

23});
24
25async function main({ type }) {
26 if (type === 'cold') {
27 bench.start();
28 await import(tmpdir.fileURL(`imported-cjs-initial.js`));
29 bench.end(1);
30 } else {
31 await import(tmpdir.fileURL(`imported-cjs-initial.js`)); // Initialize the wasm first.
32 bench.start();
33 let result;
34 for (let i = 0; i < runs; i++) {
35 result = await import(tmpdir.fileURL(`imported-cjs-${i}.js`));
36 }
37 bench.end(runs);
38 const mod = require(fixtures.path('snapshot', 'typescript.js'));
39 assert.deepStrictEqual(Object.keys(mod), Object.keys(result.default));
40 }
41}

Callers

nothing calls this directly

Calls 5

keysMethod · 0.65
requireFunction · 0.50
startMethod · 0.45
endMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected