Uh oh!
There was an error while loading. Please reload this page.
Cache discriminated contextual types - #58372
Conversation
Anders Hejlsberg (ahejlsberg)
commented
Apr 30, 2024
TypeScript Bot (@typescript-bot) test it |
Jake Bailey (jakebailey)
commented
Apr 30, 2024
TypeScript Bot (@typescript-bot) test it Sorry, the new function app we had to deploy has some scaling issues being worked out. |
TypeScript Bot (typescript-bot)
commented
Apr 30, 2024
Hey Jake Bailey (@jakebailey), the results of running the DT tests are ready. Everything looks the same! |
TypeScript Bot (typescript-bot)
commented
Apr 30, 2024
Jake Bailey (@jakebailey) Here are the results of running the user tests comparing Everything looks good! |
TypeScript Bot (typescript-bot)
commented
Apr 30, 2024
Jake Bailey (@jakebailey) Here they are:tscComparison Report - baseline..pr
System info unknown Hosts
Scenarios
Developer Information: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Jake Bailey (jakebailey)
commented
Apr 30, 2024
Wow, that's actually significant., 3% on our self test (expected), but also 1.5% in mui-docs. |
Wesley Wigham (weswigham)
left a comment
There was a problem hiding this comment.
Honestly surprised we call this with the same arguments so many times - but I guess at least twice with the same args is basically guaranteed, since signature inference is 2-pass.
Anders Hejlsberg (ahejlsberg)
commented
Apr 30, 2024
TypeScript Bot (@typescript-bot) test it |
TypeScript Bot (typescript-bot)
commented
Apr 30, 2024
Anders Hejlsberg (@ahejlsberg) Here they are:tscComparison Report - baseline..pr
System info unknown Hosts
Scenarios
Developer Information: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Anders Hejlsberg (ahejlsberg)
commented
Apr 30, 2024
Hmm, removing |
TypeScript Bot (typescript-bot)
commented
Apr 30, 2024
Jake Bailey (@jakebailey) Here are the results of running the top 400 repos comparing Everything looks good! |
David Blass (ssalbdivad)
commented
Jun 7, 2024
I bisected a perf regression typechecking https://github.com/arktypeio/arktype and found the following: {"checkTime": 9.68,"types": 483415,"instantiations": 2629152}
devDependencies:
-typescript5.5.0-dev.20240429+typescript5.5.0-dev.20240430{"checkTime": 12.2,"types": 514846,"instantiations": 2819487}It seems likely this change was somehow involved? |
Mateusz Burzyński (Andarist)
commented
Jun 7, 2024
Guided by This PR isn't part of that. |
David Blass (ssalbdivad)
commented
Jun 7, 2024
My mistake, I likely jumped to conclusions when I saw this in the release notes as a likely candidate since I use quite a lot of unions internally. Mateusz Burzyński (@Andarist) and I have been looking at which of the changes from that day could have caused such a large increase in type instantiations and check time and haven't been able to identify it yet. |
While researching another issue, Jake Bailey (@jakebailey) noticed this statement takes an exceedingly long time to type check. With the caching added in this PR, the check time for the statement drops from 250ms to about zero on my machine.