Commit db67fac
authored
Assorted niche optimizations (#19587)
These are few random micro-optimizations (plus few correctness fixes I
noticed in the process):
* De-serializing large callables/overloads is very slaw because of
`Enum.__call__()`
* Large unions _without_ literals were forced through
`make_simplified_union()` in code path that supposed to handle literals
* Now that `SomeType.__eq__()` is called more often and we preserve more
original types in `expand_type()` I added couple fast paths after
gathering call stats there.
In total this gives ~0.5% on self-check, but makes loading some numeric
libraries from cache up to 10% faster.1 parent d7753ef commit db67fac
4 files changed
+30
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
918 | 918 | | |
919 | 919 | | |
920 | 920 | | |
921 | | - | |
| 921 | + | |
922 | 922 | | |
923 | 923 | | |
924 | 924 | | |
| |||
2016 | 2016 | | |
2017 | 2017 | | |
2018 | 2018 | | |
| 2019 | + | |
| 2020 | + | |
2019 | 2021 | | |
2020 | 2022 | | |
2021 | 2023 | | |
| |||
3491 | 3493 | | |
3492 | 3494 | | |
3493 | 3495 | | |
| 3496 | + | |
| 3497 | + | |
3494 | 3498 | | |
3495 | 3499 | | |
3496 | 3500 | | |
| |||
3500 | 3504 | | |
3501 | 3505 | | |
3502 | 3506 | | |
| 3507 | + | |
| 3508 | + | |
3503 | 3509 | | |
3504 | 3510 | | |
3505 | 3511 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5636 | 5636 | | |
5637 | 5637 | | |
5638 | 5638 | | |
| 5639 | + | |
| 5640 | + | |
5639 | 5641 | | |
5640 | 5642 | | |
5641 | 5643 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
995 | 996 | | |
996 | 997 | | |
997 | 998 | | |
998 | | - | |
| 999 | + | |
999 | 1000 | | |
1000 | 1001 | | |
1001 | 1002 | | |
| |||
1017 | 1018 | | |
1018 | 1019 | | |
1019 | 1020 | | |
| 1021 | + | |
1020 | 1022 | | |
1021 | | - | |
| 1023 | + | |
| 1024 | + | |
1022 | 1025 | | |
1023 | | - | |
| 1026 | + | |
1024 | 1027 | | |
1025 | 1028 | | |
1026 | 1029 | | |
1027 | | - | |
1028 | | - | |
| 1030 | + | |
1029 | 1031 | | |
1030 | 1032 | | |
1031 | 1033 | | |
1032 | 1034 | | |
1033 | 1035 | | |
1034 | | - | |
| 1036 | + | |
1035 | 1037 | | |
1036 | 1038 | | |
1037 | 1039 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
538 | 538 | | |
539 | 539 | | |
540 | 540 | | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
541 | 545 | | |
542 | 546 | | |
543 | 547 | | |
| |||
1780 | 1784 | | |
1781 | 1785 | | |
1782 | 1786 | | |
1783 | | - | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
1784 | 1790 | | |
1785 | 1791 | | |
1786 | 1792 | | |
| |||
1797 | 1803 | | |
1798 | 1804 | | |
1799 | 1805 | | |
1800 | | - | |
| 1806 | + | |
1801 | 1807 | | |
1802 | 1808 | | |
1803 | 1809 | | |
| |||
2210 | 2216 | | |
2211 | 2217 | | |
2212 | 2218 | | |
2213 | | - | |
2214 | | - | |
2215 | | - | |
2216 | | - | |
2217 | | - | |
2218 | 2219 | | |
2219 | 2220 | | |
2220 | 2221 | | |
2221 | | - | |
2222 | 2222 | | |
2223 | 2223 | | |
2224 | 2224 | | |
| |||
2236 | 2236 | | |
2237 | 2237 | | |
2238 | 2238 | | |
2239 | | - | |
2240 | 2239 | | |
2241 | 2240 | | |
2242 | 2241 | | |
| |||
2271 | 2270 | | |
2272 | 2271 | | |
2273 | 2272 | | |
2274 | | - | |
| 2273 | + | |
2275 | 2274 | | |
2276 | 2275 | | |
2277 | | - | |
| 2276 | + | |
2278 | 2277 | | |
2279 | 2278 | | |
2280 | 2279 | | |
| |||
2931 | 2930 | | |
2932 | 2931 | | |
2933 | 2932 | | |
| 2933 | + | |
| 2934 | + | |
2934 | 2935 | | |
2935 | 2936 | | |
2936 | 2937 | | |
| |||
0 commit comments