Resolve cost scales with the repo, not the edit: scoped pass rebuilds whole candidate tables; tier 1R quadratic under its budget; startup quick_check twice; change_impact loads the whole graph #384

Closed
opened 2026-10-15 15:38:00 +02:00 by buildagent · 1 comment
Member

Measured by the 2026-10-15 performance review with 0.39.0 on copies of rust-analyzer and a synthetic 10x tree. The figures below are from a quiet machine unless noted. The cold resolve is single-threaded, and the writer phase has no stage timings.

  1. A scoped pass costs the whole repo.
    • A one-file scoped pass (28 refs) on rust-analyzer spends 2.1 s building candidate tables from EVERY symbol, 1.0 s rebuilding the full import-key relation (115,851 rows), and 1.25 s on tier-3 reachability.
    • Measured edit to clear: 4.1 s for a body edit and 10.4 s for adding a function. On the 10x tree a body edit takes 62 s.
    • Fix: when the scope is Scoped, filter the candidate and import-key builds by the scoped group names.
  2. Tier 1R grows quadratically, and its budget never fires.
    • On the 10x tree it took 1,405 s against 5.3 s on one copy. Its work estimate was 26.4M against a 50M budget.
    • Fix: calibrate the budget against wall time, so the stage degrades and says so.
  3. Every daemon start runs PRAGMA quick_check twice, once in the daemon's open and once in the watcher's. It reads every page: 1.15 s on rust-analyzer and 11 s on the 10x tree. Run it once, or only after an unclean shutdown.
  4. The graph tools load all of symbol_edges on every call (graph.rs load_edges): 200–290 ms on rust-analyzer, and a hard refusal above 1M edges. Add an index on (to_id, from_id) and walk the graph by frontier.
  5. resolution_gaps runs its candidate-pool join twice: 1.37 s on rust-analyzer, 17.7 s at 10x.
  6. Two redundant prefix indexes on refs cost about 36% of ref-insert time.

Reply size is tracked separately.

Measured by the 2026-10-15 performance review with 0.39.0 on copies of rust-analyzer and a synthetic 10x tree. The figures below are from a quiet machine unless noted. The cold resolve is single-threaded, and the writer phase has no stage timings. 1. **A scoped pass costs the whole repo.** - A one-file scoped pass (28 refs) on rust-analyzer spends 2.1 s building candidate tables from EVERY symbol, 1.0 s rebuilding the full import-key relation (115,851 rows), and 1.25 s on tier-3 reachability. - Measured edit to clear: 4.1 s for a body edit and 10.4 s for adding a function. On the 10x tree a body edit takes 62 s. - Fix: when the scope is Scoped, filter the candidate and import-key builds by the scoped group names. 2. **Tier 1R grows quadratically, and its budget never fires.** - On the 10x tree it took 1,405 s against 5.3 s on one copy. Its work estimate was 26.4M against a 50M budget. - Fix: calibrate the budget against wall time, so the stage degrades and says so. 3. **Every daemon start runs `PRAGMA quick_check` twice**, once in the daemon's open and once in the watcher's. It reads every page: 1.15 s on rust-analyzer and 11 s on the 10x tree. Run it once, or only after an unclean shutdown. 4. **The graph tools load all of `symbol_edges` on every call** (`graph.rs` `load_edges`): 200–290 ms on rust-analyzer, and a hard refusal above 1M edges. Add an index on `(to_id, from_id)` and walk the graph by frontier. 5. **`resolution_gaps` runs its candidate-pool join twice:** 1.37 s on rust-analyzer, 17.7 s at 10x. 6. **Two redundant prefix indexes on `refs`** cost about 36% of ref-insert time. Reply size is tracked separately.
Author
Member

Released in v0.40.0 (https://git.h-dv.de/h-dv/code-index/releases/tag/v0.40.0, PR #388, merge a48fb945): a scoped re-index works only on the references the edit can affect (rust-analyzer body edit 3.5 s → 1.0 s, resolved results identical on all nine pinned repos); the startup integrity check runs once per database file; change_impact and explain_dependency walk the call graph without loading all of it; resolution_gaps is faster.

Released in v0.40.0 (https://git.h-dv.de/h-dv/code-index/releases/tag/v0.40.0, PR #388, merge a48fb945): a scoped re-index works only on the references the edit can affect (rust-analyzer body edit 3.5 s → 1.0 s, resolved results identical on all nine pinned repos); the startup integrity check runs once per database file; `change_impact` and `explain_dependency` walk the call graph without loading all of it; `resolution_gaps` is faster.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
h-dv/code-index#384
No description provided.