Repository navigation
Shortcut relations in getNarrowedTypeWorker when comparing literals - #56072
Jake Bailey (jakebailey) wants to merge 7 commits into
Conversation
|
TypeScript Bot (@typescript-bot) test top100 |
|
Heya Jake Bailey (@jakebailey), I've started to run the regular perf test suite on this PR at 54d0bc7. You can monitor the build here. Update: The results are in! |
|
Heya Jake Bailey (@jakebailey), I've started to run the diff-based top-repos suite on this PR at 54d0bc7. You can monitor the build here. Update: The results are in! |
|
Heya Jake Bailey (@jakebailey), I've started to run the parallelized Definitely Typed test suite on this PR at 54d0bc7. You can monitor the build here. Update: The results are in! |
|
Heya Jake Bailey (@jakebailey), I've started to run the diff-based user code test suite on this PR at 54d0bc7. You can monitor the build here. Update: The results are in! |
|
Heya Jake Bailey (@jakebailey), I've started to run the tarball bundle task on this PR at 54d0bc7. You can monitor the build here. |
|
Hey Jake Bailey (@jakebailey), I've packed this into an installable tgz. You can install it for testing by referencing it in your and then running There is also a playground for this build and an npm module you can use via |
|
Jake Bailey (@jakebailey) Here are the results of running the user test suite comparing There were infrastructure failures potentially unrelated to your change:
Otherwise... Everything looks good! |
|
Jake Bailey (@jakebailey) Here they are:
CompilerComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
tsserverComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
StartupComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Jake Bailey (@jakebailey) Here are the results of running the top-repos suite comparing Everything looks good! |
|
Hey Jake Bailey (@jakebailey), the results of running the DT tests are ready. |
|
TypeScript Bot (@typescript-bot) perf test this |
|
Heya Jake Bailey (@jakebailey), I've started to run the regular perf test suite on this PR at 629de0d. You can monitor the build here. Update: The results are in! |
|
Jake Bailey (@jakebailey) Here they are:
CompilerComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
tsserverComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
StartupComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
TypeScript Bot (@typescript-bot) test top200 |
|
Heya Jake Bailey (@jakebailey), I've started to run the regular perf test suite on this PR at e68e177. You can monitor the build here. Update: The results are in! |
|
Heya Jake Bailey (@jakebailey), I've started to run the diff-based top-repos suite on this PR at e68e177. You can monitor the build here. Update: The results are in! |
|
Heya Jake Bailey (@jakebailey), I've started to run the diff-based user code test suite on this PR at e68e177. You can monitor the build here. Update: The results are in! |
|
Jake Bailey (@jakebailey) Here are the results of running the user test suite comparing There were infrastructure failures potentially unrelated to your change:
Otherwise... Everything looks good! |
|
Jake Bailey (@jakebailey) Here they are:
CompilerComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
tsserverComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
StartupComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hm, not very good, probably because if we're already willing to pay the cost to do relations, it's not going to be very expensive to go through simpleTypeRelated or whatever. But in the other place, we're guaranteed to call relation 4 times when the types aren't related, which is expensive on large unions. |
|
Jake Bailey (@jakebailey) Here are the results of running the top-repos suite comparing Everything looks good! |
|
TypeScript Bot (@typescript-bot) perf test this |
|
Heya Jake Bailey (@jakebailey), I've started to run the regular perf test suite on this PR at f993810. You can monitor the build here. Update: The results are in! |
|
Jake Bailey (@jakebailey) Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
tsserverComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
startupComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Jake Bailey (@jakebailey) did the results indicate that this is worth pursuing? It is worth keeping open? |
|
You can see the relevant benchmark in the original post; our current test suite doesn't have a case like this. |
For #55948
When narrowing large unions of literals, we do four different relation calls which appear to be quite costly. By checking ahead of time that we're going to relate two literals, we can skip this work by comparing the values directly and only once (as the result shouldn't be order dependent).
This leads to a significant speedup on #55948:
This PR passes all of the tests, but I think my implementation is probably wrong for some edge cases.
Like, I don't validate that the literal types are the same between the two, just their values, which is wrong. But, doesn't break?Fixed that edge case.