Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3.1k
Two more micro-optimizations#19627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
According tomypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
ilevkivskyi commentedAug 9, 2025
Btw just wanted to brag about how stable is my local bench: (you read that right, standard deviation is just 8 milliseconds) |
sterliakov left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Nice one! Please post this to plugin API announcements - I expect some plugins in wild might use this functionality (yes, undocumented, yes, private, let's just do that and let people know something might break).
since apparently pytest depends on numpy
Nowthat was interesting.
660d911 intopython:masterUh oh!
There was an error while loading.Please reload this page.
This has two things (totalling 1.5% locally, but see caveat below):
@contextmanger(that is relatively slow) forlocal_type_map, since it appears in multiple hot paths.difflibthat can be extremely slow with large modules.Btw the second will probably not affect self-check, although it did affectmy self-check, since apparently
pytestdepends onnumpy. Well, they don't specify it as a package dependency, buthttps://github.com/pytest-dev/pytest/blob/main/src/_pytest/python_api.py#L17-L18(and I have numpy installed in all my environments, LOL)