-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Cache complex union and intersection relations #37910
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 perf test this |
Heya @ahejlsberg, I've started to run the perf test suite on this PR at 1cd5b0a. You can monitor the build here. Update: The results are in! |
@ahejlsberg Here they are:Comparison Report - master..37910
System
Hosts
Scenarios
|
Not much effect on our perf test suites, so not clear how valuable this is. But it definitely has a pretty positive effect on the compiler with unions code base. |
I'm surprised there's not a more pronounced effect on Material UI but I guess it makes sense |
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.
I don't remember if we chatted about this back in April, but I'm still assigned, so 🤷. It'd be nice to enable the compiler with unions perf test (IIRC it was disabled because it caused an older version of the compiler to crash, but that shouldn't be an issue right now - cc @rbuckton - you know if/how we can turn it on?) to show the beneficial effect this actually has, but this seems OK, implementation-wise.
@rbuckton know if we can go about enabling that perf test at some point (and get some historical data for it)? @ahejlsberg we going to merge this at some point? Should it have a milestone? It looks like it needs a merge for a baseline update. |
# Conflicts: # tests/baselines/reference/classPropertyErrorOnNameOnly.errors.txt
* Cache complex union/intersection relations * Accept new baselines * Accept new baselines
We've discussed caching union and intersection relations before, but had concerns about the increased memory usage. This PR introduces caching for complex union and intersection relations, specifically those than have a combined number of constituents of at least 4. This ideally strikes a balance between time and memory.
This PR improves check time for our "compiler with unions" code base by about 12%.