-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Early couldContainTypeVariables check in instantiateType #37844
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
Conversation
@typescript-bot perf test this |
Heya @ahejlsberg, I've started to run the perf test suite on this PR at 1cc7a53. You can monitor the build here. Update: The results are in! |
@ahejlsberg Here they are:Comparison Report - master..37844
System
Hosts
Scenarios
|
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.
This is like... half of what I was thinking. There's also like {[key in ReallyBigKeyUnion]: OtherReallyBigObjectTypeUnion}
- the template could contain type variables (but doesn't), however no instantiation will affect it. - every instantiation is a noop, but for every element of ReallyBigKeyUnion
we (eventually, assuming all properties are eventually pulled on) perform an instantiation over OtherReallyBigObjectTypeUnion
(and this increment the statement instantiationCount
). Since we deferred property type instantiation, writing a test case that actually pulls on all the props in a single source element check is really difficult to do now, though.
@typescript-bot perf test this |
Heya @ahejlsberg, I've started to run the perf test suite on this PR at d45f3ef. You can monitor the build here. Update: The results are in! |
@ahejlsberg Here they are:Comparison Report - master..37844
System
Hosts
Scenarios
|
@typescript-bot perf test this |
Heya @ahejlsberg, I've started to run the perf test suite on this PR at 5d7807e. You can monitor the build here. Update: The results are in! |
@weswigham With my latest commit, |
@ahejlsberg Here they are:Comparison Report - master..37844
System
Hosts
Scenarios
|
Nothing that properly tests it since we started deferring mapped type member type instantiation. |
This PR revises
instantiateType
to perform an early check ofcouldContainTypeVariables
. Previously this check was performed in multiple places. This change also means that we don't count instantiations of types that don't contain type variables (which are basically no-ops).