Commit 660d911
authored
Two more micro-optimizations (#19627)
This has two things (totalling 1.5% locally, but see caveat below):
* Do not use `@contextmanger` (that is relatively slow) for
`local_type_map`, since it appears in multiple hot paths.
* Do not show name suggestions for import errors in third party packages
(since those errors are ignored anyway). It calls `difflib` that can be
extremely slow with large modules.
Btw the second will probably not affect self-check, although it did
affect _my_ self-check, since apparently `pytest` depends on `numpy`.
Well, they don't specify it as a package dependency, but
https://github.com/pytest-dev/pytest/blob/main/src/_pytest/python_api.py#L17-L18
```python
if TYPE_CHECKING:
from numpy import ndarray
```
(and I have numpy installed in all my environments, LOL)1 parent cc5f1e1 commit 660d911
3 files changed
+43
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
10 | 21 | | |
11 | 22 | | |
12 | 23 | | |
| |||
277 | 288 | | |
278 | 289 | | |
279 | 290 | | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
280 | 311 | | |
281 | 312 | | |
282 | 313 | | |
| |||
402 | 433 | | |
403 | 434 | | |
404 | 435 | | |
| 436 | + | |
405 | 437 | | |
406 | 438 | | |
407 | 439 | | |
| |||
4631 | 4663 | | |
4632 | 4664 | | |
4633 | 4665 | | |
4634 | | - | |
| 4666 | + | |
4635 | 4667 | | |
4636 | 4668 | | |
4637 | 4669 | | |
| |||
7458 | 7490 | | |
7459 | 7491 | | |
7460 | 7492 | | |
7461 | | - | |
7462 | | - | |
7463 | | - | |
7464 | | - | |
7465 | | - | |
7466 | | - | |
7467 | | - | |
7468 | | - | |
7469 | | - | |
7470 | | - | |
7471 | | - | |
7472 | | - | |
7473 | 7493 | | |
7474 | 7494 | | |
7475 | 7495 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1075 | 1075 | | |
1076 | 1076 | | |
1077 | 1077 | | |
1078 | | - | |
| 1078 | + | |
1079 | 1079 | | |
1080 | 1080 | | |
1081 | 1081 | | |
| |||
1440 | 1440 | | |
1441 | 1441 | | |
1442 | 1442 | | |
1443 | | - | |
| 1443 | + | |
1444 | 1444 | | |
1445 | 1445 | | |
1446 | 1446 | | |
| |||
2920 | 2920 | | |
2921 | 2921 | | |
2922 | 2922 | | |
2923 | | - | |
| 2923 | + | |
2924 | 2924 | | |
2925 | 2925 | | |
2926 | 2926 | | |
| |||
5367 | 5367 | | |
5368 | 5368 | | |
5369 | 5369 | | |
5370 | | - | |
| 5370 | + | |
5371 | 5371 | | |
5372 | 5372 | | |
5373 | 5373 | | |
| |||
6095 | 6095 | | |
6096 | 6096 | | |
6097 | 6097 | | |
6098 | | - | |
6099 | | - | |
6100 | | - | |
6101 | 6098 | | |
6102 | | - | |
| 6099 | + | |
| 6100 | + | |
6103 | 6101 | | |
6104 | 6102 | | |
6105 | 6103 | | |
6106 | | - | |
6107 | 6104 | | |
6108 | 6105 | | |
6109 | 6106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3048 | 3048 | | |
3049 | 3049 | | |
3050 | 3050 | | |
3051 | | - | |
| 3051 | + | |
| 3052 | + | |
| 3053 | + | |
3052 | 3054 | | |
3053 | 3055 | | |
3054 | 3056 | | |
| |||
0 commit comments