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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ Call resolution the fork adds:

### Measured results

Upstream `main` at `69af19ac` against the fork at `d9bd974c`, each run on Node.js 24.22.1 and on Bun 1.4.4. Index and sync figures were re-measured 2026-10-27 on the same 16-vCPU WSL2 host after the ambient-`declare module` scan fix and the resolve-pipeline changes below; MCP, command-line and explore figures are carried from the earlier 2026-10-27 run at `bc27fdb4` (unchanged by resolution-path changes). Seven corpora, arms in mirrored order; index figures are the median of two runs and sync figures the median of four. A comparison counts as a change only when the gap exceeds that comparison's own run-to-run spread — the larger of the two arms' (max − min) / median — and cells that cannot show that are marked inconclusive or no clear change rather than a fixed band. Upstream refuses to start on Bun, which reports itself as Node 26, because upstream blocks Node 25 and newer; it ran here with `CODEGRAPH_ALLOW_UNSAFE_NODE=1`. The host shared other work during the run, so spread-based cells carry more noise than a quiet host would; the numbers, the method, the graph sizes and the disclosures are in [`docs/benchmarks/fork-vs-upstream-node-bun-2026-10-27.md`](docs/benchmarks/fork-vs-upstream-node-bun-2026-10-27.md). The scripts that produced them are in [`scripts/benchmarks/runtime/`](scripts/benchmarks/runtime/).
Upstream `main` at `69af19ac` against the fork at `645abbb8`, each run on Node.js 24.22.1 and on Bun 1.4.4. Index and sync figures were re-measured 2026-10-27 on the same 16-vCPU WSL2 host after the ambient-`declare module` scan fix and the resolve-pipeline changes below; MCP, command-line and explore figures are carried from the earlier 2026-10-27 run at `bc27fdb4` (unchanged by resolution-path changes). Seven corpora, arms in mirrored order; index figures are the median of two runs and sync figures the median of four. A comparison counts as a change only when the gap exceeds that comparison's own run-to-run spread — the larger of the two arms' (max − min) / median — and cells that cannot show that are marked inconclusive or no clear change rather than a fixed band. Upstream refuses to start on Bun, which reports itself as Node 26, because upstream blocks Node 25 and newer; it ran here with `CODEGRAPH_ALLOW_UNSAFE_NODE=1`. The host shared other work during the run, so spread-based cells carry more noise than a quiet host would; the numbers, the method, the graph sizes and the disclosures are in [`docs/benchmarks/fork-vs-upstream-node-bun-2026-10-27.md`](docs/benchmarks/fork-vs-upstream-node-bun-2026-10-27.md). The scripts that produced them are in [`scripts/benchmarks/runtime/`](scripts/benchmarks/runtime/).

![Fork against upstream CodeGraph on n8n and the command line: the fork indexes n8n 1.5 times faster, syncs an edited file 1.3 times faster, answers a warm question 1.8 times faster and uses 33% less memory while indexing. The fork is better in 57 of 76 comparisons, shows no clear change in 10 and is worse in 9.](assets/fork-vs-upstream-performance.svg?v=8)

Expand Down
13 changes: 10 additions & 3 deletions docs/benchmarks/fork-vs-upstream-node-bun-2026-10-27.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Of 76 comparisons the fork is better in 57, shows no clear change in 10 and is w

## Follow-up merges

Pull requests landed on `fork/consolidated` after the tables above were generated, each measured on its stacked branch build against the same upstream numbers on the same host. The scorecard above reflects the pre-follow-up tree; the current head is `d9bd974c`.
Pull requests landed on `fork/consolidated` after the tables above were generated, each measured on its stacked branch build against the same upstream numbers on the same host. The scorecard above reflects the pre-follow-up tree; the current head is `645abbb8`.

| PR | Merge commit | Change | Measured result |
|---|---|---|---|
Expand All @@ -162,5 +162,12 @@ Pull requests landed on `fork/consolidated` after the tables above were generate
| [#563](https://github.com/bompus/codegraph/pull/563) | `6b2e7ae1` | Kernel flat-buffer extraction restored when framework `extract()` hooks are configured — hooks run in parse workers, extras ride the transport | pretix exact graph parity (32799/73404/165700); n8n Node index RSS 8.26 → 7.41 GiB (−10%) |
| [#564](https://github.com/bompus/codegraph/pull/564) | `96afc781` | README revision bump + framework fast-path accounting | Documentation only |
| [#565](https://github.com/bompus/codegraph/pull/565) | `d9bd974c` | Exact/fuzzy name-match pools decline past 256 when the source file is generated or ≥75% of the pool is generated artifacts — never a truncated winner | pretix exact parity held; pathological ~950 ms resolve chunks bounded to ≤250 ms; overall batch wall flat (~19 k spread-out vendored-JS refs) |

What is left on the board after the merges: pretix-Bun index (~+2%, the 0.5 s settle tail plus ~1.4 s of serial post-phases — at the measured optimum of the tuning explored), the pretix and supabase-Bun index-memory cells (the 12 in-process worker heaps that buy the index-time wins), a ~0% gin file-watcher cell inside noise, and the diffuse per-candidate gate cost on vendored JS that keeps pretix's largest resolve batch at ~2.7 s. Everything else in the 9-cell loss list is now a win: pretix-Bun sync (#559), n8n busy-MCP memory (#560) and the gin concurrent-explore wave (#560).
| [#566](https://github.com/bompus/codegraph/pull/566) | `a403ef5e` | `js_declaration_reachable`'s candidate-side declaration walk memoized by (candidate id, ref language) — the ref-language half of the key is load-bearing because `parsed_tree` selects its parser from the reference language | pretix exact parity; wall flat — the memo check still sat behind ~6 file/tree preamble loads (reordered by #569) |
| [#567](https://github.com/bompus/codegraph/pull/567) | `330bf232` | README/benchmark doc refresh to `d9bd974c` with the #562–#565 rows | Documentation only |
| [#568](https://github.com/bompus/codegraph/pull/568) | `0ca7c001` | Explore warm path: `getSizeStats` memoized on the DB change stamp (was a guaranteed `COUNT(*)` + `GROUP BY` per explore call), `getContext`'s per-edge `getNodeById` loops batched through `getNodesByIds`, `findEdgesBetweenNodes` on the statement-shape cache | 40 focused tests green; per-call wins, no corpus-level figure — the items sit under the explore median already measured |
| [#569](https://github.com/bompus/codegraph/pull/569) | `2d385c6d` | `js_decl_scope_memo` checked before the file/tree preamble loads; `bare` regex one-entry memo per ref loop; `.d.ts` HashSet built lazily | pretix exact parity; settle 4.73 → 4.57 s (−3.5%) |
| [#570](https://github.com/bompus/codegraph/pull/570) | `e31b8947` | `bare_call_receiver` memoized on a content hash of ref-identifying fields; `is_generated_file`'s ~25 regexes memoized per unique path; both memos cleared at each batch boundary | pretix exact parity; with #571–#572, settle 4.57 → ~3.5 s (−23%; 3.2–3.7 s across two profiled index runs) |
| [#571](https://github.com/bompus/codegraph/pull/571) | `dfb8866f` | `local_declaration_scope` memo keyed by node id in its own map — drops the `format!` alloc the shared map needed for namespacing | parity 8/8; with #570/#572, settle 4.57 → ~3.5 s |
| [#572](https://github.com/bompus/codegraph/pull/572) | `645abbb8` | `apply_language_gate` filters in place (`retain`) — drops a `Vec<Arc<KNode>>` alloc per ref | parity 8/8; timing-neutral alloc shave |

What is left on the board after the merges: pretix-Bun index (~+2%, the 0.5 s settle tail plus ~1.4 s of serial post-phases — at the measured optimum of the tuning explored), the pretix and supabase-Bun index-memory cells (the 12 in-process worker heaps that buy the index-time wins), a ~0% gin file-watcher cell inside noise, and the still-diffuse per-candidate gate cost on vendored JS — #569–#572 cut pretix's resolution settle 4.73 → ~3.5 s (−26%, median of two profiled runs) but the residual is spread across many small gates rather than one dominant one. Everything else in the 9-cell loss list is now a win: pretix-Bun sync (#559), n8n busy-MCP memory (#560) and the gin concurrent-explore wave (#560).