-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
A perf regression between 2018-12-20 and 2018-12-21 #57028
Comments
This is likely due to #51085 (comment). The inhabitedness code is now used in a lot more places, and it's extremely slow. |
It was an improvement, but it doesn't look like the issue is solved. I'd reopen, but I can't override bors. |
Yeah, clearly that wasn't (all of) it. I remember another perf issue in this code (set intersections are not lazy -- they continue even if the intersection is already empty), but will have to profile to make sure this is really the right issue this time... |
Short-circuit DefIdForest::intersection() If the forest is already empty, there is no point in intersecting further. Also handle the first element separately, so we don't compute an unnecessary intersection between the full forest and the first element, which is always equal to the first element. This is the second try at fixing #57028, as the previous attempt only recovered part of the regression. I checked locally that this drops time spent in ty::inhabitedness for syn-check a lot, though not to zero. r? @varkor
With the second fix the really large regression is gone, but we're still not at parity: https://perf.rust-lang.org/compare.html?start=2018-12-20&end=fa922ab876cb3140de2ead9c8ad88a75982c167c&stat=instructions%3Au This code will need some more optimization, or possibly needs to be turned into a query so it can be cached. |
Triage: almost two years later, it's not clear to me exactly what this would be tracking these days. |
Instructions and wall-time took a noticeable hit due to one of these changes.
instructions:
wall-time:
Cc @varkor (I narrowed it down)
The text was updated successfully, but these errors were encountered: