-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Revert substitution type simplification #31400
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
I should mention that this is solely a batch compilation issue. Statement completion performance is not affected and remains snappy in |
Just decomposing a substitute had such an outsized perf diff? This implies that we're skipping work we should be doing during the styled components batch build because we get an unexpected substitute out of |
I don't think it implies that. Rather, I'm thinking it's because when simplification removes substitution types, we end up "skipping over" types that involve substitution types and thus miss results we've previously cached.
Tried it. We never hit the |
Ah, because of all the times when we call |
Possibly. But if so, that would be a new PR. The purpose of this PR is simply to revert a change that we didn't want. |
True, although I thought the original intent of doing this was to recursively unwrap - it just turns out it has negative performance characteristics because of the other things it affects (ergo, to re-implement the original recursive-unwrapping intent after reverting this change, we'd need to do a bit more than a straight revert). We've not have a commit in master that had deferred conditional type simplification without recursive substitution unwrapping yet, so as-is, reverting this does have the potential to reveal new, possibly unforeseen undesirable behavior. What I'm saying is this: Yes, right now it's a "revert", but IMO a better PR would be a refactor that removes the substitution unwrapping from simplification but still does recursive unwrapping/simplifying within to top of |
I'm simply removing a late change that had no basis in demonstrated real world issues and reverting back to a state that is closer to where we were before. We can discuss alternate solutions in another PR. I'm going to run our RWC and DT tests and if they come through clean I'm going to merge this. |
@typescript-bot test this |
Heya @ahejlsberg, I've started to run the extended test suite on this PR at 92a1547. You can monitor the build here. It should now contribute to this PR's status checks. |
@typescript-bot run dt |
Heya @ahejlsberg, I've started to run the parallelized Definitely Typed test suite on this PR at 92a1547. You can monitor the build here. It should now contribute to this PR's status checks. |
In #31354 I included a late change to simplify substitution types along with other simplifiable types. That was not a good idea. It had an outsize impact on batch compilation of
styled-components
:This PR reverts the change, leaving substitution type simplification as it was. This reduces check time by about 25-30% and gets us back to the expected levels:
Ideally we'll get this into 3.5 RC.