You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(resolution): avoid repeated local-binding checks per exact-name match #2870
matchByExactName() checks whether a JS/TS name binds locally for each eligible cross-file candidate.
The check uses the same filename and name throughout one matcher call. isLocallyBoundJsName() memoizes the answer, but each call still constructs a key and queries the cache.
The #2829 figure of 5.5 seconds covers complete resolveOne calls with exact-match outcomes.
It does not measure matchByExactName() itself.
Import candidates already leave the exact-name pool before ranking.
This issue does not request another import filter.
On CodeGraph at 9c4794d6, temporary probes record 123,724 exact-name calls and 1,209,451 candidate visits.
They record 387,362 local-binding checks. Only 15,392 are the first check within their matcher call. findBestMatch() runs 2,559 times and takes about 11 milliseconds with probe overhead.
The repeated local-binding check is a measured, narrow target.
Proposed change
Store the Boolean result lazily within one matchByExactName() invocation.
Keep the check at its current filter position.
Preserve candidate IDs, order, strategy priority, scoring, ties, ambiguity, confidence, and import aliases.
Add no global cache or new resolution rule.
Validation
Compare complete nodes, edges, and unresolved_refs after fresh indexing and incremental symbol changes.
Include raw edge metadata in the comparison.
Normalize only the node indexing timestamp.
Run the full suite and five alternating paired benchmarks in both resolver modes.
Report the repeated-check count and measured wall and CPU times separately.
Fixed by #2934 (from #2871, thanks @luojiyin1987): the local-binding answer is now kept for the whole exact-name match, so each match asks once instead of once per candidate. The graph output is byte-identical; it ships in the next release.
Activity
colbymchenry commentedon Oct 27, 2026
Fixed by #2934 (from #2871, thanks @luojiyin1987): the local-binding answer is now kept for the whole exact-name match, so each match asks once instead of once per candidate. The graph output is byte-identical; it ships in the next release.
perf(resolution): read a bare JS/TS call's local binding once per mat…