Skip to content
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

Skip unnecessary py.typed file exist checks. #7652

Merged
merged 5 commits into from
Apr 9, 2024

Conversation

heejaechang
Copy link
Collaborator

In importResolver, it already checks if a py.typed file exists before calling getPyTypedInfo, using the file system cache, so there's no need to recheck it inside getPyTypedInfo. This minor improvement results in a 500~1000ms speed boost for certain cases where the py.typed file is checked across many folders, such as in indexer.

It would be beneficial to extend the cache to the file system itself so all code could benefit from it, but for now, the improvement is specific to the importResolver, where the cache exists.

image

vs

image

This comment has been minimized.

@microsoft microsoft deleted a comment from github-actions bot Apr 9, 2024

This comment has been minimized.

Copy link
Contributor

github-actions bot commented Apr 9, 2024

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@heejaechang heejaechang merged commit bd08098 into microsoft:main Apr 9, 2024
12 checks passed
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants