also looking at this
perf(isolated): benchmark declaration generation paths
#3106
4 files
+215
-6
| @@ -62,11 +62,26 @@ interface PhaseTimingSuiteResult { | ||
| 62 | 62 | fileSize: number |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | interface GenerationModeComparison { | |
| 66 | name: string | |
| 67 | inputSize: number | |
| 68 | isolated: BenchmarkResult | |
| 69 | semantic: BenchmarkResult | |
| 70 | speedup: number | |
| 71 | } | |
| 72 | ||
| 73 | interface GenerationModeSuiteResult { | |
| 74 | name: string | |
| 75 | comparisons: GenerationModeComparison[] | |
| 76 | totalTimeMs: number | |
| 77 | } | |
| 78 | ||
| 65 | 79 | interface BenchmarkOutput { |
| 66 | 80 | timestamp: string |
| 67 | 81 | platform: string |
| 68 | 82 | nodeVersion: string |
| 69 | 83 | suites: SuiteResult[] |
| 84 | generationModes?: GenerationModeSuiteResult | |
| 70 | 85 | phaseTimings: PhaseTimingSuiteResult[] |
| 71 | 86 | summary: { totalTimeMs: number, totalBenchmarks: number, avgTimeMs: number } |
| 72 | 87 | } |
| @@ -418,6 +433,18 @@ let md = '## Benchmark Results\n\n' | ||
| 418 | 433 | const runtime = typeof globalThis.Bun !== 'undefined' ? `Bun ${(globalThis as any).Bun.version}` : results.nodeVersion |
| 419 | 434 | md += `**Platform:** ${results.platform} | **Runtime:** ${runtime} | **Date:** ${results.timestamp.split('T')[0]}\n\n` |
| 420 | 435 | |
| 436 | if (results.generationModes?.comparisons.length) { | |
| 437 | md += '### isolatedDeclarations vs Semantic Generation\n\n' | |
| 438 | md += '_Uncached end-to-end declaration generation over identical, fully annotated sources._\n\n' | |
| 439 | md += '| Workload | Input | isolatedDeclarations | Semantic | Speedup |\n' | |
| 440 | md += '|----------|-------|----------------------|----------|---------|\n' | |
| 441 | for (const comparison of results.generationModes.comparisons) { | |
| 442 | const status = comparison.speedup >= 2 ? ':green_circle:' : comparison.speedup >= 1 ? ':yellow_circle:' : ':red_circle:' | |
| 443 | md += `| ${comparison.name} | ${(comparison.inputSize / 1024).toFixed(0)} KiB | ${fmt(comparison.isolated.avgTimeMs)} | ${fmt(comparison.semantic.avgTimeMs)} | ${status} **${comparison.speedup.toFixed(1)}x** |\n` | |
| 444 | } | |
| 445 | md += '\n' | |
| 446 | } | |
| 447 | ||
| 421 | 448 | // --- Cached table --- |
| 422 | 449 | const cachedTools: { name: string, getTime: (r: CrossToolResult) => number | null }[] = [ |
| 423 | 450 | { name: '**dtsx (cached)**', getTime: r => r.dtsx.avg }, |