Commit 98a3502
authored
Auto merge of #37152 - arielb1:drop-cache, r=pnkfelix
add a per-param-env cache to `impls_bound`
There used to be only a global cache, which led to uncached calls to
trait selection when there were type parameters.
This causes a 20% decrease in borrow-checking time and an overall 0.5% performance increase during bootstrapping (as borrow-checking tends to be a tiny part of compilation time).
Fixes #37106 (drop elaboration times are now ~half of borrow checking,
so might still be worthy of optimization, but not critical).
r? @pnkfelixFile tree
5 files changed
+41
-27
lines changed- src
- librustc_typeck/check
- librustc
- traits
- ty
5 files changed
+41
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
339 | | - | |
| 339 | + | |
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
1220 | 1220 | | |
1221 | 1221 | | |
1222 | 1222 | | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
1223 | 1229 | | |
1224 | 1230 | | |
1225 | 1231 | | |
| |||
1232 | 1238 | | |
1233 | 1239 | | |
1234 | 1240 | | |
| 1241 | + | |
| 1242 | + | |
1235 | 1243 | | |
1236 | 1244 | | |
1237 | 1245 | | |
| |||
2773 | 2781 | | |
2774 | 2782 | | |
2775 | 2783 | | |
2776 | | - | |
| 2784 | + | |
| 2785 | + | |
| 2786 | + | |
2777 | 2787 | | |
2778 | 2788 | | |
2779 | 2789 | | |
| |||
2844 | 2854 | | |
2845 | 2855 | | |
2846 | 2856 | | |
| 2857 | + | |
| 2858 | + | |
2847 | 2859 | | |
2848 | 2860 | | |
2849 | 2861 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
901 | 901 | | |
902 | 902 | | |
903 | 903 | | |
904 | | - | |
905 | | - | |
906 | | - | |
907 | | - | |
908 | | - | |
909 | | - | |
910 | | - | |
911 | | - | |
912 | | - | |
913 | | - | |
914 | | - | |
915 | | - | |
916 | | - | |
917 | | - | |
918 | | - | |
919 | | - | |
920 | | - | |
921 | 904 | | |
922 | 905 | | |
923 | 906 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| 27 | + | |
26 | 28 | | |
27 | 29 | | |
28 | 30 | | |
| |||
579 | 581 | | |
580 | 582 | | |
581 | 583 | | |
582 | | - | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
583 | 587 | | |
584 | | - | |
585 | | - | |
586 | | - | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
587 | 602 | | |
588 | 603 | | |
589 | 604 | | |
| |||
610 | 625 | | |
611 | 626 | | |
612 | 627 | | |
613 | | - | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
614 | 631 | | |
615 | 632 | | |
616 | 633 | | |
| |||
650 | 667 | | |
651 | 668 | | |
652 | 669 | | |
653 | | - | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
654 | 673 | | |
655 | 674 | | |
656 | 675 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1458 | 1458 | | |
1459 | 1459 | | |
1460 | 1460 | | |
1461 | | - | |
| 1461 | + | |
1462 | 1462 | | |
1463 | 1463 | | |
1464 | 1464 | | |
| |||
0 commit comments