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

Function measureDir

benchmark/module/module-loader.js:44–59  ·  view source on GitHub ↗
(n, cache, files, name)

Source from the content-addressed store, hash-verified

42}
43
44function measureDir(n, cache, files, name) {
45 if (cache) {
46 for (let i = 0; i <= files; i++) {
47 require(`${benchmarkDirectory}${i}${name}`);
48 }
49 }
50 bench.start();
51 for (let i = 0; i <= files; i++) {
52 for (let j = 0; j < n; j++)
53 require(`${benchmarkDirectory}${i}${name}`);
54 // Pretend mixed input (otherwise the results are less representative due to
55 // highly specialized code).
56 require(otherModules[i % otherModules.length]);
57 }
58 bench.end(n * files);
59}

Callers 1

mainFunction · 0.70

Calls 3

requireFunction · 0.50
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…