Skip to content

Speed up type argument checking#16353

Merged
hauntsaninja merged 1 commit intomasterfrom
fast-type-arg
Oct 29, 2023
Merged

Speed up type argument checking#16353
hauntsaninja merged 1 commit intomasterfrom
fast-type-arg

Conversation

@JukkaL
Copy link
Copy Markdown
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
Copy Markdown
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
@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