()
| 192 | // --------------------------------------------------------------------------- |
| 193 | |
| 194 | async 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 | |
| 218 | main().catch(console.error) |
no test coverage detected