Cache getConstraintOfDistributiveConditionalType#53358
Cache getConstraintOfDistributiveConditionalType#53358jakebailey merged 3 commits intomicrosoft:mainfrom
Conversation
|
@typescript-bot test this |
|
Heya @jakebailey, I've started to run the abridged perf test suite on this PR at 5301906. You can monitor the build here. Update: The results are in! |
|
Heya @jakebailey, I've started to run the diff-based top-repos suite on this PR at 5301906. You can monitor the build here. Update: The results are in! |
|
Heya @jakebailey, I've started to run the parallelized Definitely Typed test suite on this PR at 5301906. You can monitor the build here. Update: The results are in! |
|
Heya @jakebailey, I've started to run the diff-based user code test suite on this PR at 5301906. You can monitor the build here. Update: The results are in! |
|
Heya @jakebailey, I've started to run the extended test suite on this PR at 5301906. You can monitor the build here. |
|
@jakebailey Here are the results of running the user test suite comparing Everything looks good! |
|
@jakebailey Here they are:Comparison Report - main..53358
System
Hosts
Scenarios
Developer Information: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@jakebailey Here are the results of running the top-repos suite comparing Everything looks good! |
|
Hey @jakebailey, the results of running the DT tests are ready. |
src/compiler/types.ts
Outdated
| /** @internal */ | ||
| resolvedDefaultConstraint?: Type; | ||
| /** @internal */ | ||
| resolvedDefaultConstraintOfDistributed?: Type | false; |
There was a problem hiding this comment.
| resolvedDefaultConstraintOfDistributed?: Type | false; | |
| resolvedDefaultConstraintOfDistributive?: Type | false; | |
it'd be weird to not match the function name, y'know. Plus, a distributive conditional we're getting the distributive constraint of can't have been distributed yet, since, if it was, we wouldn't have a distributive conditional anymore.
There was a problem hiding this comment.
Hm, then maybe this should really just be resolvedConstraintOfDistributive to match the function? I think I brainfarted when copying the declaration above to rename it and just kept the word "default" without thinking about it.
There was a problem hiding this comment.
I changed it to the straight substring of the function name, which isn't exactly what you said but I think is actually correct.
For #51188
In the perf graphs of #53346, a lot of the time is spent in
getConstraintOfDistributiveConditionalType. We can cache it likegetDefaultConstraintOfConditionalType. This function can return undefined, so we have to use a different value thanundefinedto indicate this case (as undefined is "not yet calculated").On top of main, this nets:
This compounds with #53346; both together nets: