MCPcopy
hub / github.com/vitejs/vite / main

Function main

packages/vite/scripts/benchCircularImport.ts:194–216  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

192// ---------------------------------------------------------------------------
193
194async function main() {
195 console.log('=== Vite isCircularImport Benchmark ===\n')
196
197 const scales = [100, 500, 1000, 2000, 5000]
198 const results: BenchResult[] = []
199
200 // Warmup: single small run to trigger JIT compilation
201 await runBenchmark({ moduleCount: 100, avgImports: 3, cycleFraction: 0.05 })
202
203 for (const n of scales) {
204 const result = await runBenchmark({
205 moduleCount: n,
206 avgImports: 3,
207 cycleFraction: 0.05,
208 })
209 results.push(result)
210
211 console.log(`N=${n}:`)
212 console.log(` modules: ${result.moduleCount}, edges: ${result.edgeCount}`)
213 console.log(` time: ${result.timeMs.toFixed(1)}ms`)
214 console.log()
215 }
216}
217
218main().catch(console.error)

Callers 1

Calls 2

runBenchmarkFunction · 0.85
logMethod · 0.80

Tested by

no test coverage detected