Performance work on the extract/build/update pipeline, plus a batch of extractor and build fixes. Every entry marked Perf preserves graph output exactly (byte-identical); the extractor fixes change output and share one AST cache schema bump (see the note at the end).
- Perf: ids
normalize_idgets an ASCII fast-path, pre-compiled regexes and an LRU cache, so the common (ASCII, repeated) identifier case skips the Unicode normalization loop. ~1.26x on the compute path and a large win on repeated ids, which recurs heavily across a corpus. - Perf: cache
save_cachedbuilds the portable on-disk payload copy-on-write instead ofcopy.deepcopy-ing every per-file result; ~20% faster on the cache-write transform, scaling with per-file graph size. The input is never mutated and the on-disk bytes are identical. - Perf: extract each source file is read from disk once (the key hash and the parse share one buffer) instead of twice on a cold build, and the tree-sitter
Parseris reused per language within a worker instead of rebuilt per file (file reads roughly halved on the worker path). - Perf: extract the cross-file resolution finalize builds its shared node/edge indexes in a few fused passes instead of ~6 independent full scans of the graph; ~15% faster on the finalize stage.
- Perf: watch the no-change topology comparison uses an order-independent content hash computed in one pass instead of sorting and re-serializing the whole graph; ~1.4x on that compare.
- Perf: cluster the community partition is cached by a topology hash and reused when the graph is unchanged (~9x on a cluster cache hit), and the deterministic edge-sort key drops a per-edge
json.dumpsin favour of a cheap tuple key (identical ordering). - Perf: analyze
suggest_questions' betweenness centrality now runs a flat-array Brandes implementation instead of networkx's dict-based one, with bit-for-bit identical scores; ~2.6x faster, growing with graph size (#5303, thanks @Max17190). - Perf: watch each preserved source path is rebased once per incremental update instead of recomputed per node and edge; the update output is byte-identical (#5322, thanks @Max17190).
- Fix: java a field or class annotated with Lombok
@Gettergets the synthesizedgetX()/isX()getter node javac sees, soobj.getX()resolves to it; boolean fields useisX,@Getter(AccessLevel.NONE)is respected, a hand-written getter is not duplicated, and a non-Lombok@Getteris ignored (#5148, thanks @Deepjyoti-Sarmah). - Fix: kotlin a member call on a receiver with a declared type (parameter, property,
val x: T, orval x = T()) binds to that type's method across files instead of the last same-named method in the file, and interface calls dispatch to their implementers; an ambiguous or unknown receiver fails closed (#5355, thanks @xiongjianxu). - Fix: sql a PostgreSQL PL/pgSQL routine body that the grammar only parses through ERROR recovery (
RETURN QUERY SELECT ... FROM t) has its table reads recovered asreads_fromedges instead of dropped (#5349, thanks @Deepjyoti-Sarmah). - Fix: build when an AST-extracted edge and a semantic (LLM) copy of the same edge tie, the deterministic EXTRACTED edge is kept, so a later docs
--updateno longer deletes a code edge that a semantic copy had overwritten (#5334, thanks @Ildar-gn). - Fix: sql a T-SQL procedure whose header the grammar only partly parses (tree-sitter-sql 0.3.12+ misreads the name, absorbing unparenthesised params or a
""/]]escape) yields a single routine node instead of a duplicate under the misread id; a real routine sharing the misread's line is kept (#5236, thanks @Deepjyoti-Sarmah). - Fix: vbnet a method declared after a multi-line string literal is no longer dropped: the file is reparsed with multi-line strings flattened to a line-preserving placeholder first, so an unterminated string on one line no longer swallows the rest of the class; single-line files are parsed unchanged (#5320, thanks @Deepjyoti-Sarmah).
- Fix: cpp a
std::-qualified type (std::chrono::seconds,std::vector<T>) is no longer rewired onto a same-named project symbol; the std reference gets its own sourceless stub the corpus rewire skips, while the std type's template arguments still resolve to the project's own types (#5219, thanks @deba2k5). - Fix: python a plain
import modwheremodsits on asys.path.insert(...)directory (a non-package script dir) now bindsmod.func()to thefuncfunction node, matched to the unique file on that path and failing closed on ambiguity or a stdlib name; acallsedge is no longer aliased onto a file node (#5253, thanks @madhusudanpatnaik). - Fix: serve a query that filters on the
callrelation now keeps cross-repocallsedges (written asrelation=calls, context=cross_repo), which were silently dropped by the context-only filter (#5257, thanks @LHopitalOne). - Fix: build a member's structural
method/containsedge to its owner is kept over an opposite-direction member-usage edge (a method reading its class's own static property or constant), so the member no longer vanishes from the type's walk; non-usage relations (inherits/implements) keep the existing rule (#2391, thanks @livingforelvis).
The AST cache schema is bumped to 50; warm caches re-run the affected Kotlin, Java, SQL, VB.NET, C++ and Python (sys.path import) extractions.