ReviewOS

also looking at this

stacks/dtsx

perf(isolated): benchmark declaration generation paths

#3106
Merged chris wants to merge codex/isolated-mode-benchmarks into main
4 files +215 -6
benchmark/ci-summary.tsmodified+27-0
Changes to benchmark/ci-summary.ts
@@ -62,11 +62,26 @@ interface PhaseTimingSuiteResult {
6262 fileSize: number
6363}
6464
65interface GenerationModeComparison {
66 name: string
67 inputSize: number
68 isolated: BenchmarkResult
69 semantic: BenchmarkResult
70 speedup: number
71}
72
73interface GenerationModeSuiteResult {
74 name: string
75 comparisons: GenerationModeComparison[]
76 totalTimeMs: number
77}
78
6579interface BenchmarkOutput {
6680 timestamp: string
6781 platform: string
6882 nodeVersion: string
6983 suites: SuiteResult[]
84 generationModes?: GenerationModeSuiteResult
7085 phaseTimings: PhaseTimingSuiteResult[]
7186 summary: { totalTimeMs: number, totalBenchmarks: number, avgTimeMs: number }
7287}
@@ -418,6 +433,18 @@ let md = '## Benchmark Results\n\n'
418433const runtime = typeof globalThis.Bun !== 'undefined' ? `Bun ${(globalThis as any).Bun.version}` : results.nodeVersion
419434md += `**Platform:** ${results.platform} | **Runtime:** ${runtime} | **Date:** ${results.timestamp.split('T')[0]}\n\n`
420435
436if (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
421448// --- Cached table ---
422449const cachedTools: { name: string, getTime: (r: CrossToolResult) => number | null }[] = [
423450 { name: '**dtsx (cached)**', getTime: r => r.dtsx.avg },