-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filter to possible package paths before trying to resolve a module. #18038
Conversation
With a long sys.path (it's got 300 entries), this removes 94% of stat syscalls from running mypy. With all the filesystem caching, that's only a small time savings, though it will depend on your filesystem.
This comment has been minimized.
This comment has been minimized.
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.
Awesome stuff! I pushed two commits to try and get tests passing, I'll also run this through the benchmarking setup that I had going :-)
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
b773887
to
fbc8ff0
Compare
Okay, I benchmarked ac79825 as the following on
I'll check the extra Doing this also uncovered a minor regression from #15347 , which I shall try to fix... (update: I think best done in a new PR) |
This comment has been minimized.
This comment has been minimized.
fbc8ff0
to
e018d5d
Compare
e018d5d
to
778dbec
Compare
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
Follow up to #18038 This maybe should have been two PRs
With a long sys.path (it's got 300 entries), this removes 94% of stat syscalls from running mypy. With all the filesystem caching, that's only a small time savings, though it will depend on your filesystem. Local benchmarks showed a 20% time savings but they're pretty noisy from all the I/O.