-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Always cache relations involving intersection types #46523
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 test this |
Heya @ahejlsberg, I've started to run the abridged perf test suite on this PR at 8c278bf. You can monitor the build here. Update: The results are in! |
Heya @ahejlsberg, I've started to run the extended test suite on this PR at 8c278bf. You can monitor the build here. |
Heya @ahejlsberg, I've started to run the inline community code test suite on this PR at 8c278bf. You can monitor the build here. Update: The results are in! |
Heya @ahejlsberg, I've started to run the parallelized Definitely Typed test suite on this PR at 8c278bf. You can monitor the build here. |
@ahejlsberg Here they are:Comparison Report - main..46523
System
Hosts
Scenarios
Developer Information: |
@ahejlsberg |
No effect on performance from this one, so definitely a better fix than #46505. |
@@ -94,5 +91,4 @@ tests/cases/conformance/types/union/unionTypeCallSignatures6.ts(55,1): error TS2 | |||
!!! error TS2769: Type 'void' is not assignable to type 'A'. | |||
!!! error TS2769: Overload 2 of 2, '(this: A & B): void', gave the following error. | |||
!!! error TS2769: The 'this' context of type 'void' is not assignable to method's 'this' of type 'A & B'. | |||
!!! error TS2769: Type 'void' is not assignable to type 'A'. |
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.
The loss of this ending of the elaboration is a little unfortunate since the line above it is kind of an earfull.
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.
Yeah, but that's basically the effect we get from caching the relation.
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.
Huh, this actually reduced memory usage for Compiler - Unions
. We sure we can't also just cache all union relations as well, and not just those involving more than 4 union members? It'd simplify the code a bit.
@weswigham We already tried that back when, but let's get some fresh data: #46528. |
Well, #46528 doesn't indicate much of a difference, but I'm going to be conservative and keep the non-caching behavior for small unions. |
Was this meant to be picked into 4.5, or was it intentionally 4.6? The issue's milestone is 4.5.1. |
I think we should pick it for 4.5 if possible. It's a 4.5 specific regression, probably not too common, but hard to know. I'd say the fix is very safe indeed. |
@typescript-bot cherry-pick this to release-4.5 |
Heya @DanielRosenwasser, I've started to run the task to cherry-pick this into |
Hey @DanielRosenwasser, I couldn't open a PR with the cherry-pick. (You can check the log here). You may need to squash and pick this PR into release-4.5 manually. |
* Always cache relations involving intersection types * Accept new baselines * Add regression test
An alternative fix for #46500, hopefully with less impact on the
material-ui
performance test.Fixes #46500.