-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Investigate recent regression on Material UI from contextual discrimination changes #48298
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
Comments
cc @erikbrinkman who may or may not still be interested in the saga of this issue |
@weswigham I'm happy to drill into this more, given that I don't know the typescript codebase as well as your (or others) I have a few pointers that would help me:
Thanks! And sorry in advance for the headache of the regression. I think it'd be great if this could be kept, but also if the cut comes up, just chuck this and I can resubmit it later with some guideposts on the potential regression. |
Unfortunately, we don't keep our perf tests in a public repo. Fortunately, in this case, it's just the compiler run on material-ui right off GitHub. (Admittedly an old version, but that hopefully shouldn't matter for tracking down the perf issue) debugging / profiling - it may be helpful to time individual sections, are there tools in place to help with this sort of profiling?
There is not any docs per sey, but types are checker local, so just storing the results in an appropriately keyed map in the type itself should work. (The only interesting things we do for caching is look-aside tables for caches associated with symbols and nodes since those can last thru multiple checker runs - |
I'm having trouble reproducing the regression. Below are the times in seconds for each sub-package of material-ui (tag v5.5.1) as profiled by lerna in non-parallel mode on my machine. I ran the tests for three commit hashes, the one right before this PR, the current main branch, and the main branch with a reversion commit of this pr.
There does seem to be a significant regression between before the PR and main, although it appears to be at most 20% not the 80% that seen in the attached graph. Strangely, simply reverting the commit makes things significantly worse. I'm running these on WSL so maybe that's why there's weird diagnostic overheads. It's also probably worth noting that I get errors on both branches that aren't main, having to do with The only thing I can think of is that maybe material-ui has changed. Is it possible to get the commit hash of the version your profiling is based off of? Alternatively would it be hard for someone to verify the profiling behavior on v5.5.1 of material-ui? |
I don't have an exact SHA, but I can tell you it's from |
And the benchmark in question is building |
Thanks for the tips! I'm still struggling to reproduce. On the latest tag (v5.5.1) the pinned typescript reports no errors, but there are errors with ~v4.4 (so all the versions I'm comparing for timing). On v4.8.3. If I ignore the errors and look at timing, then I still can't reproduce the performance regression. I could try to fix all of the errors on v4.8.3, but it's not clear if the way that I fix them will show consistent regressions. Also, apriori I have no estimate for how difficult fixing them is going to be. I know you don't have a commit hash for what your benchmarking on, but I imagine to test recent versions of the compiler you've had to make independent patches on top of the cut you took. Is there any chance you can upload a patch of those commits? Ideally just something where tsc v4.4 works when applied to 4.8.3. |
My repro steps:
(This is largely from memory, so I may have missed a step) |
Actually, I believe the benchmark remains immutable and we eventually end up measuring how long it takes to produce appropriate errors. |
Thanks so much @amcasey for the context. I can now reproduce! |
#43937 seems to have regressed our check times on material UI drastically.
We'll need to address this before TS 4.7
Originally posted by @DanielRosenwasser in #43937 (comment)
The text was updated successfully, but these errors were encountered: