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

Function main

benchmark/esm/esm-loader-defaultResolve.js:33–50  ·  view source on GitHub ↗
(conf)

Source from the content-addressed store, hash-verified

31const bench = common.createBenchmark(main, configs, options);
32
33function main(conf) {
34 const { defaultResolve } = require('internal/modules/esm/resolve');
35 tmpdir.refresh();
36
37 fs.mkdirSync(path.join(benchmarkDirectory, 'node_modules', 'unprefixed-existing'), { recursive: true });
38 fs.writeFileSync(path.join(benchmarkDirectory, 'node_modules', 'unprefixed-existing', 'index.js'), '\n');
39 fs.writeFileSync(path.join(benchmarkDirectory, 'relative-existing.js'), '\n');
40
41 bench.start();
42
43 for (let i = 0; i < conf.n; i++) {
44 try {
45 defaultResolve(conf.specifier, { parentURL });
46 } catch { /* empty */ }
47 }
48
49 bench.end(conf.n);
50}

Callers

nothing calls this directly

Calls 8

requireFunction · 0.50
defaultResolveFunction · 0.50
refreshMethod · 0.45
mkdirSyncMethod · 0.45
joinMethod · 0.45
writeFileSyncMethod · 0.45
startMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…