Commit ab9d718
perf: Cache import mappings and index fuzzy matches for resolution
Two major optimizations for the ref resolution phase:
1. Cache extractImportMappings() results per file path — previously
re-read and re-parsed the source file for every single ref from
that file (e.g. 100 refs from one file = 100 identical file reads)
2. Replace linear scan in matchFuzzy() with a lazily-built
case-insensitive Map index — O(1) lookup instead of iterating
all function/method/class nodes for every unresolved ref.
Also drop low-value prefix matching (confidence 0.3).
Co-Authored-By: Claude Opus 4.6 <[email protected]>1 parent 44ea6af commit ab9d718
3 files changed
Lines changed: 53 additions & 33 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
425 | 425 | | |
426 | 426 | | |
427 | 427 | | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
428 | 438 | | |
429 | 439 | | |
430 | 440 | | |
431 | 441 | | |
432 | 442 | | |
433 | 443 | | |
434 | 444 | | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
439 | 454 | | |
440 | 455 | | |
441 | | - | |
442 | | - | |
443 | 456 | | |
444 | 457 | | |
445 | 458 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
| 19 | + | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
193 | 203 | | |
194 | 204 | | |
195 | 205 | | |
196 | 206 | | |
197 | 207 | | |
198 | 208 | | |
199 | 209 | | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
206 | 226 | | |
207 | 227 | | |
208 | 228 | | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
| 229 | + | |
| 230 | + | |
213 | 231 | | |
214 | | - | |
| 232 | + | |
215 | 233 | | |
216 | 234 | | |
217 | 235 | | |
| |||
220 | 238 | | |
221 | 239 | | |
222 | 240 | | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
| 241 | + | |
237 | 242 | | |
238 | 243 | | |
239 | 244 | | |
| |||
0 commit comments