Skip to content

Latest commit

 

History

History
6020 lines (5997 loc) · 144 KB

File metadata and controls

6020 lines (5997 loc) · 144 KB

Codegraph Performance Benchmarks

Self-measured on every release by running codegraph on its own codebase. Metrics are normalized per file for cross-version comparability.

Version Engine Date Files Build (ms/file) Query (ms) Nodes/file Edges/file DB (bytes/file)
3.9.6 native 2026-04-30 744 5.8 ↑81% 47 ↑60% 24 ↓6% 50 ↓7% 41422 ↓7%
3.9.6 wasm 2026-04-30 742 28.3 ↑74% 42.8 ↓3% 24.3 ~ 50.5 ~ 41335 ↑6%
3.9.4 native 2026-04-18 668 3.2 ↓3% 29.4 ~ 25.6 ~ 53.8 ↑4% 44590 ~
3.9.4 wasm 2026-04-18 728 16.3 ↑3% 44.1 ↑6% 24.3 ~ 51.4 ↑4% 38839 ~
3.9.3 native 2026-04-13 727 3.3 ↓79% 29.5 ↑11% 25.4 ~ 51.6 ~ 43981 ↑7%
3.9.3 wasm 2026-04-13 727 15.9 ↑6% 41.6 ↑4% 24.1 ~ 49.3 ~ 38380 ~
3.9.2 native 2026-04-09 727 15.7 ↑54% 26.6 ↑14% 25.3 ↓10% 51.4 ↓10% 41028 ↓15%
3.9.2 wasm 2026-04-09 727 15 ↑9% 40.1 ↑13% 24 ↓15% 49.2 ↓14% 38256 ↓16%
3.9.1 native 2026-04-06 570 10.2 ↓20% 23.4 ↓23% 28.1 ↑3% 56.9 ↑5% 48433 ↑8%
3.9.1 wasm 2026-04-06 570 13.7 ↑5% 35.6 ↑16% 28.1 ↑3% 56.9 ↑5% 45717 ↑2%
3.9.0 native 2026-04-04 567 12.8 ↓4% 30.4 ↑5% 27.3 ~ 54 ↑14% 44666 ↑2%
3.9.0 wasm 2026-04-04 567 13.1 ↓4% 30.6 ↓4% 27.3 ~ 54 ~ 44623 ↑5%
3.8.1 native 2026-04-03 565 13.3 ↑533% 28.9 ↑113% 27 ↑4% 47.5 ↑5% 43693 ↑42%
3.8.1 wasm 2026-04-03 565 13.6 ↑518% 31.8 ↑108% 27.2 ↑5% 53.8 ↑19% 42417 ↑39%
3.8.0 native 2026-04-02 564 2.1 13.6 26 45.3 30851
3.8.0 wasm 2026-04-02 564 2.2 ↓85% 15.3 ↑22% 26 ~ 45.3 ↓10% 30524 ↓43%
3.7.0 wasm 2026-04-01 532 14.2 ↑7% 12.5 ~ 25.8 ~ 50.3 ~ 53795 ~
3.6.0 wasm 2026-03-30 514 13.3 ↑12% 12.3 ~ 25.6 ↑10% 49.5 ↑12% 54013 ↑28%
3.4.1 native 2026-03-27 473 5.7 ↑8% 11.7 ~ 23.2 ~ 44.1 ~ 57725 ↑5%
3.4.1 wasm 2026-03-27 473 11.9 ↓2% 12.2 ↑4% 23.2 ~ 44.1 ~ 42276 ↑5%
3.4.0 native 2026-03-26 473 5.3 ↓13% 11.6 ↑63% 23.2 ↑32% 44.2 ↑21% 55041 ↑13%
3.4.0 wasm 2026-03-26 473 12.2 ↑9% 11.7 ↑62% 23.1 ↑32% 44.4 ↑22% 40198 ↓15%
3.3.1 native 2026-03-20 442 6.1 ↑74% 7.1 ↑122% 17.6 ↑31% 36.5 ↑27% 48707 ↑10%
3.3.1 wasm 2026-03-20 442 11.2 ↑17% 7.2 ↑57% 17.5 ↑31% 36.4 ↑26% 47317 ↑10%
3.1.4 native 2026-03-16 398 3.5 ↓31% 3.2 ↓18% 13.4 ↓26% 28.8 ↓27% 44469 ↓32%
3.1.4 wasm 2026-03-16 398 9.6 ↓34% 4.6 ↓16% 13.4 ↓26% 28.9 ↓27% 42823 ↓32%
3.1.3 native 2026-03-12 236 5.1 ~ 3.9 ↓7% 18 ~ 39.4 ↑2% 65553 ~
3.1.3 wasm 2026-03-12 236 14.6 ↓3% 5.5 ↓5% 18 ~ 39.6 ~ 63037 ~
3.1.2 native 2026-03-11 235 5.2 ↓15% 4.2 ↑24% 17.9 ↓14% 38.6 ↓14% 65275 ↓19%
3.1.2 wasm 2026-03-11 235 15 ↓9% 5.8 ↑26% 17.9 ↓14% 39.3 ↓13% 62207 ↓20%
3.1.0 native 2026-03-08 180 6.1 ~ 3.4 ↑3% 20.8 ~ 44.7 ~ 80919 ↑14%
3.1.0 wasm 2026-03-08 180 16.5 ↓13% 4.6 ↓4% 20.9 ~ 45 ~ 77665 ~
3.0.4 native 2026-03-06 177 6.2 ↓50% 3.3 ↓3% 20.6 ↑10% 44.5 ↑7% 70951 ↓4%
3.0.4 wasm 2026-03-06 177 19 ↑17% 4.8 ↑4% 20.6 ↑10% 44.7 ↑7% 77245 ↑4%
3.0.3 native 2026-03-04 172 12.3 ↑7% 3.4 ↑3% 18.8 ~ 41.6 ~ 74133 ~
3.0.3 wasm 2026-03-04 172 16.3 ↓8% 4.6 ↑5% 18.7 ~ 41.6 ~ 74300 ~
3.0.2 native 2026-03-04 172 11.5 ↓18% 3.3 ↓3% 18.8 ↓29% 41.6 ↓17% 74109 ↓5%
3.0.2 wasm 2026-03-04 172 17.8 ↓27% 4.4 ↓2% 18.7 ↓2% 41.6 ~ 74252 ~
3.0.1 native 2026-03-04 165 14.1 ↑220% 3.4 ↑6% 26.6 ↑43% 50 ↑20% 78246 ↑91%
3.0.1 wasm 2026-03-04 165 24.4 ↑78% 4.5 ↓10% 19.1 ↑6% 42.4 ↑3% 74870 ↑19%
3.0.0 native 2026-03-03 164 4.4 ↑132% 3.2 ↑19% 18.6 ↑195% 41.6 ↑262% 41010 ↑682%
3.0.0 wasm 2026-03-03 164 13.7 ↑65% 5 ↑11% 18.1 ↑187% 41.1 ↑257% 63063 ↑1102%
2.6.0 native 2026-03-02 146 1.9 ~ 2.7 ↑29% 6.3 ↓3% 11.5 ↑4% 5246 ↓5%
2.6.0 wasm 2026-03-02 146 8.3 ↑6% 4.5 ↑50% 6.3 ↓3% 11.5 ↑4% 5246 ↓5%
2.5.1 native 2026-03-01 126 1.9 ↓5% 2.1 ↓12% 6.5 ~ 11.1 ~ 5526 ~
2.5.1 wasm 2026-03-01 126 7.8 ↓7% 3 ↓14% 6.5 ~ 11.1 ~ 5526 ~
2.5.0 native 2026-02-28 123 2 2.4 6.5 11.1 5595
2.5.0 wasm 2026-02-28 123 8.4 ↑65% 3.5 ↑59% 6.5 ~ 11.1 ↑4% 5595 ↑19%
2.4.0 wasm 2026-02-28 123 5.1 ↓23% 2.2 ↑5% 6.5 ↑12% 10.7 ↑18% 4695 ↑22%
2.3.0 native 2026-02-24 99 1.9 ~ 1.5 ↑7% 5.8 ↑7% 9.1 ~ 3848 ~
2.3.0 wasm 2026-02-24 99 6.6 ~ 2.1 ↑11% 5.8 ~ 9.1 ↑3% 3848 ~
2.1.0 native 2026-02-23 92 1.9 ↓24% 1.4 ↑17% 5.4 ↑6% 9.1 ↓47% 3829 ↓14%
2.1.0 wasm 2026-02-23 92 6.6 ↑32% 1.9 ↑19% 5.7 ↑12% 8.8 ↓46% 3829 ↓12%
2.0.0 native 2026-02-23 89 2.5 1.2 5.1 17.2 4464
2.0.0 wasm 2026-02-23 89 5 1.6 5.1 16.2 4372

Raw totals (latest)

Native (Rust)

Metric Value
Build time 4.3s
Query time 47ms
Nodes 17,834
Edges 37,164
DB size 29.4 MB
Files 744

WASM

Metric Value
Build time 21.0s
Query time 43ms
Nodes 18,061
Edges 37,469
DB size 29.3 MB
Files 742

Build Phase Breakdown (latest)

Phase Native (build) WASM (build) Native (1-file) WASM (1-file)
Parse 635.8 ms 11596 ms 0.5 ms 4.1 ms
Insert nodes 375.7 ms 406.5 ms 0.3 ms 0.4 ms
Resolve imports 4.2 ms 19.5 ms 0.5 ms 0.5 ms
Build edges 193.7 ms 303.5 ms 7.1 ms 1.5 ms
Structure 35.6 ms 82.7 ms 6.9 ms 3.1 ms
Roles 89.2 ms 97.8 ms 39.7 ms 25.3 ms
AST nodes 240.5 ms 325.7 ms 0.3 ms 0.6 ms
Complexity 19 ms 1122.6 ms 0 ms 0.8 ms
CFG 188.2 ms 322.3 ms 0 ms 0.7 ms
Dataflow 165.5 ms 220.9 ms 0 ms 0.4 ms

Estimated performance at 50,000 files

Extrapolated linearly from per-file metrics above.

Metric Native (Rust) WASM
Build time 290.0s 1415.0s
DB size 1975.2 MB 1971.0 MB
Nodes 1,200,000 1,215,000
Edges 2,500,000 2,525,000

Incremental Rebuilds

Version Engine No-op (ms) 1-file (ms)
3.9.6 native 13 ↑30% 78 ↓80%
3.9.6 wasm 134 ↑538% 68 ↑6%
3.9.4 native 10 ↓9% 400 ~
3.9.4 wasm 21 ↓5% 64 ↓90%
3.9.3 native 11 ↑22% 397 ↓29%
3.9.3 wasm 22 ↑10% 638 ↑2%
3.9.2 native 9 ↓47% 558 ↓27%
3.9.2 wasm 20 ↑33% 624 ↓2%
3.9.1 native 17 ↑113% 767 ↑36%
3.9.1 wasm 15 ~ 639 ↑14%
3.9.0 native 8 ~ 562 ↑1238%
3.9.0 wasm 15 ↓6% 559 ↓7%
3.8.1 native 8 ~ 42 ↑27%
3.8.1 wasm 16 ↑100% 600 ↑1718%
3.8.0 native 8 33
3.8.0 wasm 8 ↓47% 33 ↓94%
3.7.0 wasm 15 ↑7% 542 ~
3.6.0 wasm 14 ↓12% 547 ↑12%
3.4.1 native 14 ↑17% 316 ↓27%
3.4.1 wasm 16 ↑60% 487 ↓22%
3.4.0 native 12 ~ 432 ↑22%
3.4.0 wasm 10 ↓17% 621 ↑23%
3.3.1 native 12 ↑33% 353 ↑33%
3.3.1 wasm 12 ↑20% 506 ↑35%
3.1.4 native 9 ↑50% 265 ↓6%
3.1.4 wasm 10 ↑67% 375 ↓24%
3.1.3 native 6 ~ 282 ↓5%
3.1.3 wasm 6 ↓14% 493 ↓12%
3.1.2 native 6 ↑20% 296 ↓11%
3.1.2 wasm 7 ↑40% 563 ~
3.1.0 native 5 ↓98% 332 ~
3.1.0 wasm 5 ↓29% 570 ~
3.0.4 native 329 ↑6480% 335 ↓11%
3.0.4 wasm 7 ~ 559 ~
3.0.3 native 5 ~ 375 ↓2%
3.0.3 wasm 7 ↑40% 567 ↓3%
3.0.2 native 5 ~ 384 ↓58%
3.0.2 wasm 5 ~ 584 ↓42%
3.0.1 native 5 ↑25% 915 ↑182%
3.0.1 wasm 5 ~ 1012 ↓5%
3.0.0 native 4 ~ 325 ↑162%
3.0.0 wasm 5 ↓29% 1068 ↑112%
2.6.0 native 4 ↑33% 124 ↑33%
2.6.0 wasm 7 ↑75% 504 ↑56%
2.5.1 native 3 ↓25% 93 ↓4%
2.5.1 wasm 4 ~ 324 ~
2.5.0 native 4 97
2.5.0 wasm 4 ↓20% 324 ↑69%
2.4.0 wasm 5 192

Query Latency

Version Engine fn-deps (ms) fn-impact (ms) path (ms) roles (ms)
3.9.6 native 3.4 ↑36% 3.1 ↑24% 3.1 ↑29% 37 ↓5%
3.9.6 wasm 2.4 ↑9% 2.4 ↑4% 2.2 ~ 31.3 ↓4%
3.9.4 native 2.5 ~ 2.5 ~ 2.4 ↓4% 39 ↓6%
3.9.4 wasm 2.2 ↓8% 2.3 ↓4% 2.2 ↓4% 32.6 ↓6%
3.9.3 native 2.5 ↑9% 2.5 ↑4% 2.5 ~ 41.3 ↑24%
3.9.3 wasm 2.4 ~ 2.4 ~ 2.3 ↓4% 34.5 ↓3%
3.9.2 native 2.3 ↑5% 2.4 ↑4% 2.5 ↑14% 33.2 ↑30%
3.9.2 wasm 2.4 ↑9% 2.4 ↑9% 2.4 ↑9% 35.4 ↑35%
3.9.1 native 2.2 ↑5% 2.3 ↑5% 2.2 ~ 25.5 ~
3.9.1 wasm 2.2 ↑5% 2.2 ~ 2.2 ↑5% 26.3 ~
3.9.0 native 2.1 ↓5% 2.2 ~ 2.2 ~ 25.9 ↓13%
3.9.0 wasm 2.1 ↓5% 2.2 ~ 2.1 ↓5% 26.6 ↓6%
3.8.1 native 2.2 ↓12% 2.2 ~ 2.2 ↑5% 29.7 ~
3.8.1 wasm 2.2 ~ 2.2 ~ 2.2 ↑5% 28.4 ↓9%
3.8.0 native 2.5 2.2 2.1 29.2
3.8.0 wasm 2.2 ↑10% 2.2 ↑5% 2.1 ↑5% 31.3 ↑28%
3.7.0 wasm 2 ↓5% 2.1 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3.0.1 wasm 0.8 ~ 0.9 ~ 0.8 ~ 5.2 ↓5%
3.0.0 native 0.8 ↓43% 0.8 ↓38% 0.8 ↓43% 4.9 ↑308%
3.0.0 wasm 0.8 ↓43% 0.9 ↓36% 0.8 ↓43% 5.5 ↑323%
2.6.0 native 1.4 ↓22% 1.3 ~ 1.4 ↑40% 1.2 ↑20%
2.6.0 wasm 1.4 ↓22% 1.4 ↑8% 1.4 ↑40% 1.3 ↑18%
2.5.1 native 1.8 ↓14% 1.3 ↓19% 1 ↓17% 1 ↓9%
2.5.1 wasm 1.8 ↓18% 1.3 ↓19% 1 ↓17% 1.1 ~
2.5.0 native 2.1 1.6 1.2 1.1
2.5.0 wasm 2.2 ↑340% 1.6 ↑220% 1.2 1.1 ↑22%
2.4.0 wasm 0.5 0.5 null 0.9

Notes

Native 1-file rebuild regression (v3.8.1 42 ms → v3.9.0 562 ms, ↑1238%): The native incremental path is re-running graph-wide work on single-file rebuilds. The phase breakdown shows structureMs at 151.7 ms for a 1-file rebuild vs 54.1 ms for the full 567-file build, and setupMs at 38.2 ms vs 5.5 ms. AST/complexity/CFG/dataflow phases also jump from near-zero to 20-28 ms each, suggesting these phases are not scoped to only the changed file. WASM 1-file rebuild (559 ms) is superficially similar in total time but has a different root cause: WASM is parse-dominated (parseMs 258.2 ms accounts for nearly half the total) while structureMs (28.3 ms), astMs/cfgMs/dataflowMs (all under 1 ms) are correctly scoped. The native regression is specifically in graph-wide phases being re-run during incremental builds. The no-op rebuild (8 ms native, 15 ms WASM) is unaffected, confirming the regression is triggered by actual file-change detection.

Engine edge divergence (v3.9.0, 1 edge): Native reports 30,609 edges and WASM reports 30,610 for the same 567-file codebase (node counts match at 15,483). This is a parity bug — tracked in #855.

WASM regression (v2.0.0 → v2.1.0, ↑32% — persists in v2.3.0): The "v2.1.0" entry was measured after the v2.1.0 tag on main, when package.json still read "2.1.0" but the codebase already included post-release features: receiver field extraction (b08c2b2) and Commander/Express callback extraction (2ac24ef). Both added WASM-to-JS boundary crossings on every call_expression AST node. The native engine was unaffected because its Rust extractors have zero boundary overhead — and it gained a net 24% speedup from the ~45% edge reduction introduced by scoped call-resolution fallback (3a11191). For WASM the extra crossings outweighed the edge savings. A targeted fix in d4ef6da gated extractCallbackDefinition behind a member_expression type check and eliminated redundant childForFieldName 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.

Build regression (v3.1.4 3.5 ms/file → v3.3.0 8 ms/file, +129% native): The codebase grew from 398 to 429 files (+8%), but the per-file regression is real and driven by richer extraction. Between v3.1.4 and v3.3.0, type inference was extended to all typed languages (#501), receiver type tracking with graded confidence was added (#505), re-exported barrel file symbols are now tracked (#515), and package.json exports + monorepo workspace resolution was introduced (#509). These produce 33% more nodes/file (13.4 → 17.8) and 28% more edges/file (28.8 → 36.8). The Parse phase tripled on native (468 → 1511 ms) because extractors now perform additional AST traversals for type annotations and receiver resolution. The Complexity phase grew 10× (16 → 179 ms) because 33% more functions each require full AST analysis. Major refactors also decomposed monolithic extractors into per-category handlers (#490) and split domain/feature modules (#491, #492), adding 31 new source files — the benchmark measures codegraph on itself, so more source files amplify per-file overhead.

Native build regression (v3.0.0 4.4 ms/file → v3.0.3 12.3 ms/file): The regression is entirely from new build phases added in v3.0.1 that are now default-on: AST node extraction (651ms), dataflow analysis (367ms), and CFG construction (169ms) — totalling ~1,187ms of new work. The original seven phases (parse, insert, resolve, edges, structure, roles, complexity) actually got slightly faster (728ms → 542ms). As of v3.1.0, CFG and dataflow run natively in Rust, eliminating the redundant WASM pre-parse that previously added ~388ms on native builds.