Commit 997a426
authored
Improve caching granularity by using partial fingerprints of ModuleGraph #4594
Previously, we shared a single ModuleGraph across all files. Any change
to an import header would invalidate the cache for all rules that
depended on the ModuleGraph, causing redundant rebuilds and slowing down
compilation (see #4443).
We now continue to build and share the full ModuleGraph, but only compute
partial fingerprints for it. Compilation rules now depend only on the
relevant fingerprinted subset, assuming that use sites do not depend on
parts excluded from the fingerprint. This reduces unnecessary
recompilation and improves caching precision.
Key changes:
- Added fingerprint rules for partial ModuleGraph views:
- GetModuleGraphTransDepsFingerprints
- GetModuleGraphTransReverseDepsFingerprints
- GetModuleGraphImmediateReverseDepsFingerprints
- Introduced useWithSeparateFingerprintRule and useWithSeparateFingerprintRule_
- Updated rules that use GetModuleGraph to use the new fingerprint rules
This improves incremental compilation performance by avoiding full graph
invalidations when only a small part changes.1 parent f162053 commit 997a426
File tree
6 files changed
+145
-32
lines changed- ghcide/src/Development/IDE
- Core
- Import
- plugins/hls-eval-plugin/src/Ide/Plugin/Eval
6 files changed
+145
-32
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
267 | | - | |
| 267 | + | |
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
77 | 83 | | |
78 | 84 | | |
79 | 85 | | |
| |||
417 | 423 | | |
418 | 424 | | |
419 | 425 | | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
420 | 441 | | |
421 | 442 | | |
422 | 443 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
472 | 472 | | |
473 | 473 | | |
474 | 474 | | |
475 | | - | |
| 475 | + | |
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
| |||
608 | 608 | | |
609 | 609 | | |
610 | 610 | | |
611 | | - | |
| 611 | + | |
612 | 612 | | |
613 | 613 | | |
614 | 614 | | |
| |||
643 | 643 | | |
644 | 644 | | |
645 | 645 | | |
646 | | - | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
647 | 650 | | |
648 | 651 | | |
649 | 652 | | |
| |||
652 | 655 | | |
653 | 656 | | |
654 | 657 | | |
| 658 | + | |
655 | 659 | | |
656 | | - | |
| 660 | + | |
657 | 661 | | |
658 | 662 | | |
659 | 663 | | |
660 | 664 | | |
661 | 665 | | |
662 | | - | |
| 666 | + | |
663 | 667 | | |
664 | 668 | | |
665 | 669 | | |
| |||
756 | 760 | | |
757 | 761 | | |
758 | 762 | | |
| 763 | + | |
759 | 764 | | |
760 | 765 | | |
761 | | - | |
| 766 | + | |
762 | 767 | | |
763 | 768 | | |
764 | 769 | | |
| |||
771 | 776 | | |
772 | 777 | | |
773 | 778 | | |
774 | | - | |
775 | 779 | | |
776 | 780 | | |
777 | 781 | | |
| |||
801 | 805 | | |
802 | 806 | | |
803 | 807 | | |
804 | | - | |
| 808 | + | |
805 | 809 | | |
806 | 810 | | |
807 | 811 | | |
| |||
977 | 981 | | |
978 | 982 | | |
979 | 983 | | |
980 | | - | |
| 984 | + | |
981 | 985 | | |
982 | 986 | | |
983 | 987 | | |
| |||
1135 | 1139 | | |
1136 | 1140 | | |
1137 | 1141 | | |
1138 | | - | |
| 1142 | + | |
1139 | 1143 | | |
1140 | 1144 | | |
1141 | 1145 | | |
| |||
1247 | 1251 | | |
1248 | 1252 | | |
1249 | 1253 | | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
1250 | 1267 | | |
1251 | 1268 | | |
1252 | 1269 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
1148 | 1150 | | |
1149 | 1151 | | |
1150 | 1152 | | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
1151 | 1170 | | |
1152 | 1171 | | |
1153 | 1172 | | |
| |||
Lines changed: 69 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| 53 | + | |
| 54 | + | |
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
| |||
136 | 139 | | |
137 | 140 | | |
138 | 141 | | |
139 | | - | |
| 142 | + | |
140 | 143 | | |
141 | | - | |
142 | | - | |
| 144 | + | |
| 145 | + | |
143 | 146 | | |
144 | 147 | | |
145 | | - | |
| 148 | + | |
146 | 149 | | |
147 | | - | |
| 150 | + | |
148 | 151 | | |
149 | | - | |
| 152 | + | |
150 | 153 | | |
151 | | - | |
| 154 | + | |
152 | 155 | | |
153 | | - | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
154 | 163 | | |
155 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
156 | 171 | | |
157 | 172 | | |
158 | 173 | | |
| |||
228 | 243 | | |
229 | 244 | | |
230 | 245 | | |
231 | | - | |
232 | | - | |
| 246 | + | |
| 247 | + | |
233 | 248 | | |
234 | 249 | | |
235 | 250 | | |
| |||
239 | 254 | | |
240 | 255 | | |
241 | 256 | | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
242 | 260 | | |
243 | 261 | | |
244 | 262 | | |
| |||
398 | 416 | | |
399 | 417 | | |
400 | 418 | | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
0 commit comments