Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions generated/benchmarks/BUILD-BENCHMARKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,16 @@ calls, but the v2.3.0 CI benchmark confirms this was **insufficient** — WASM
remains at 6.6 ms/file (vs 5.0 in v2.0.0). The WASM/Native ratio widened from
2.0x to 3.5x. Further optimization of WASM boundary crossings in the JS
extractor is needed to recover the regression.

**Native build regression (v3.0.0 4.4 ms/file → v3.0.3 12.3 ms/file):** The regression is entirely
from four new build phases added in v3.0.1 that are now default-on: AST node extraction (651ms),
WASM pre-parse (388ms), dataflow analysis (367ms), and CFG construction (169ms) — totalling ~1,575ms
of new work. The original seven phases (parse, insert, resolve, edges, structure, roles, complexity)
actually got slightly faster (728ms → 542ms). The WASM pre-parse phase exists because CFG, dataflow,
and complexity are implemented in JS and need tree-sitter AST trees to walk, but the native Rust engine
only returns extracted symbols — not AST trees. So on native builds, all 172 files get parsed twice:
once by Rust (85ms) and once by WASM (388ms). Eliminating this double-parse requires either implementing
CFG/dataflow in Rust, or having the native engine expose tree-sitter trees to JS.
<!-- NOTES_END -->

<!-- BENCHMARK_DATA
Expand Down
6 changes: 5 additions & 1 deletion scripts/update-benchmark-report.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,19 @@ for (const engineKey of ['native', 'wasm']) {
const hasPhases = latest.native?.phases || latest.wasm?.phases;
if (hasPhases) {
md += '### Build Phase Breakdown (latest)\n\n';
const phaseKeys = ['parseMs', 'insertMs', 'resolveMs', 'edgesMs', 'structureMs', 'rolesMs', 'complexityMs'];
const phaseKeys = ['parseMs', 'wasmPreMs', 'insertMs', 'resolveMs', 'edgesMs', 'structureMs', 'rolesMs', 'astMs', 'complexityMs', 'cfgMs', 'dataflowMs'];
const phaseLabels = {
parseMs: 'Parse',
wasmPreMs: 'WASM pre-parse',
insertMs: 'Insert nodes',
resolveMs: 'Resolve imports',
edgesMs: 'Build edges',
structureMs: 'Structure',
rolesMs: 'Roles',
astMs: 'AST nodes',
complexityMs: 'Complexity',
cfgMs: 'CFG',
dataflowMs: 'Dataflow',
};

md += '| Phase | Native | WASM |\n';
Expand Down