Commit 1d4ba6b
committed
perf(robot): speed up namespace cache loading with source hints and top-level-only imports
Add resolved_resource_sources to NamespaceData that maps import hint
keys to resolved file paths. During from_data() re-resolution, these
hints skip expensive find_resource() filesystem searches when the
cached path still exists on disk.
Also limit cached imports to top-level only (recursive imports are
re-discovered during resolution), replace Path-based normalization
with string-only os.path calls in imports_manager, and add a hint_key
property to Import for consistent key computation.1 parent 05142c8 commit 1d4ba6b
File tree
4 files changed
+36
-6
lines changed- packages/robot/src/robotcode/robot/diagnostics
4 files changed
+36
-6
lines changedLines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
| |||
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
| 89 | + | |
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
| |||
112 | 114 | | |
113 | 115 | | |
114 | 116 | | |
| 117 | + | |
115 | 118 | | |
116 | | - | |
| 119 | + | |
117 | 120 | | |
| 121 | + | |
| 122 | + | |
118 | 123 | | |
119 | 124 | | |
120 | 125 | | |
| |||
395 | 400 | | |
396 | 401 | | |
397 | 402 | | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
398 | 410 | | |
399 | 411 | | |
400 | 412 | | |
401 | 413 | | |
402 | 414 | | |
| 415 | + | |
403 | 416 | | |
404 | 417 | | |
405 | 418 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1852 | 1852 | | |
1853 | 1853 | | |
1854 | 1854 | | |
1855 | | - | |
| 1855 | + | |
1856 | 1856 | | |
1857 | | - | |
| 1857 | + | |
1858 | 1858 | | |
1859 | 1859 | | |
1860 | 1860 | | |
1861 | | - | |
| 1861 | + | |
1862 | 1862 | | |
1863 | 1863 | | |
1864 | 1864 | | |
| |||
Lines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
129 | 135 | | |
130 | 136 | | |
131 | 137 | | |
| |||
494 | 500 | | |
495 | 501 | | |
496 | 502 | | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
497 | 509 | | |
498 | 510 | | |
499 | 511 | | |
500 | 512 | | |
501 | 513 | | |
502 | 514 | | |
503 | | - | |
| 515 | + | |
504 | 516 | | |
505 | 517 | | |
506 | 518 | | |
| |||
511 | 523 | | |
512 | 524 | | |
513 | 525 | | |
| 526 | + | |
514 | 527 | | |
515 | 528 | | |
516 | 529 | | |
| |||
542 | 555 | | |
543 | 556 | | |
544 | 557 | | |
545 | | - | |
| 558 | + | |
546 | 559 | | |
547 | 560 | | |
548 | 561 | | |
| |||
0 commit comments