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

Speed up type argument checking #16353

Merged
merged 1 commit into from
Oct 29, 2023
Merged

Speed up type argument checking #16353

merged 1 commit into from
Oct 29, 2023

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Oct 28, 2023

The upper bound is usually object, so add a fast path and skip a potentially slow subtype check if that's the case. Also make type annotations more precise.

This seems to at least speed up type checker tests, by 1-2% or so. This also potentially speeds up self-check a bit, though probably by less than 1%.

The upper bound is usually `object`, so add a fast path and skip a
potentially slow subtype check if that's the case. Also make type
annotations more precise.

This seems to at least speed up type checker tests, by 1-2% or so.
This also potentially speeds up self-check a bit, though probably by
less than 1%.
@github-actions
Copy link
Contributor

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

@hauntsaninja hauntsaninja merged commit 65a068e into master Oct 29, 2023
17 checks passed
@hauntsaninja hauntsaninja deleted the fast-type-arg branch October 29, 2023 06:45
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.

3 participants