Commit 6d1d744
authored
Use unqualified NameIDs for tracking constant references (#217)
This PR continues the work to unlock constant resolution. This one adds
an identity map of unqualified names using the `NameId` from #213 and
starts using it for constant references.
With unqualified Name IDs + listing namespace members (next PR), we can
actually resolve constant references based on lexical scope - unblocking
a good chunk of the resolution phase.
**Note**: there's not much difference in terms of indexing time from
this change, but memory was reduced quite a bit. Maybe we can store
method parameter names as unqualified name ids too?
<details>
<summary>Benchmark on Core</summary>
```
BEFORE
Initialization 0.001s ( 0.0%)
Listing 1.234s ( 34.1%)
Indexing 2.156s ( 59.5%)
Querying 0.230s ( 6.4%)
Cleanup 0.000s ( 0.0%)
Total: 3.621s
Indexed 87014 files
Found 700824 names
Found 894881 definitions
Found 87014 URIs
----------------------------------------
Maximum Resident Set Size: 708247552 bytes (675.43 MB)
Peak Memory Footprint: 685114280 bytes (653.37 MB)
Execution Time: 3.86 seconds
AFTER
Initialization 0.001s ( 0.0%)
Listing 1.230s ( 33.4%)
Indexing 2.173s ( 59.0%)
Querying 0.277s ( 7.5%)
Cleanup 0.000s ( 0.0%)
Total: 3.681s
Indexed 87014 files
Found 700824 names
Found 894881 definitions
Found 87014 URIs
----------------------------------------
Maximum Resident Set Size: 577536000 bytes (550.78 MB)
Peak Memory Footprint: 551961392 bytes (526.39 MB)
Execution Time: 3.90 seconds
```
</details>1 parent 8965244 commit 6d1d744
File tree
3 files changed
+46
-35
lines changed- rust/saturn/src
- indexing
- model
3 files changed
+46
-35
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
| 317 | + | |
317 | 318 | | |
318 | 319 | | |
319 | 320 | | |
320 | 321 | | |
321 | 322 | | |
322 | | - | |
| 323 | + | |
323 | 324 | | |
324 | 325 | | |
325 | | - | |
| 326 | + | |
326 | 327 | | |
327 | 328 | | |
328 | 329 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| |||
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| 43 | + | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
| |||
90 | 93 | | |
91 | 94 | | |
92 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
93 | 103 | | |
94 | 104 | | |
95 | 105 | | |
| |||
339 | 349 | | |
340 | 350 | | |
341 | 351 | | |
| 352 | + | |
342 | 353 | | |
343 | 354 | | |
344 | 355 | | |
| |||
649 | 660 | | |
650 | 661 | | |
651 | 662 | | |
652 | | - | |
| 663 | + | |
653 | 664 | | |
654 | 665 | | |
655 | | - | |
| 666 | + | |
656 | 667 | | |
657 | 668 | | |
658 | 669 | | |
| |||
681 | 692 | | |
682 | 693 | | |
683 | 694 | | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
| 695 | + | |
| 696 | + | |
689 | 697 | | |
690 | 698 | | |
691 | 699 | | |
| |||
713 | 721 | | |
714 | 722 | | |
715 | 723 | | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
720 | | - | |
| 724 | + | |
| 725 | + | |
721 | 726 | | |
722 | 727 | | |
723 | 728 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
26 | 30 | | |
| 31 | + | |
27 | 32 | | |
28 | 33 | | |
29 | 34 | | |
30 | 35 | | |
31 | 36 | | |
32 | | - | |
| 37 | + | |
33 | 38 | | |
34 | | - | |
| 39 | + | |
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
40 | 45 | | |
41 | 46 | | |
42 | | - | |
43 | | - | |
| 47 | + | |
| 48 | + | |
44 | 49 | | |
45 | 50 | | |
46 | 51 | | |
47 | | - | |
| 52 | + | |
48 | 53 | | |
49 | 54 | | |
50 | 55 | | |
| |||
0 commit comments