-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Reduce the extra overhead caused by greedy equal_unions
#48410
Conversation
15a6be7
to
9b58ccb
Compare
@nanosoldier |
Your package evaluation job has completed - no new issues were detected. |
The cleanup commit LGTM. I think we could make that a separate PR and merge that immediately. The first idea ("Avoid repeated failing equal_union.") seems logical to me. If I understand it correctly, this is just a change to the heuristic search order (whether we consider this to be exhausting the Lunions or Runions). And since we were already treating this as an Runion branch, it was not necessary to have the fall-through happen immediately, as we are already guaranteed to revisit that later if needed. The second one seems less certain to me (meaning mostly that i am still trying to understand it better). I guess there we will then be eagerly exploring all of the Runion choices starting from this point. Why do we not doing that always when handling an Runion? Should we do that always for Runions (when !sub) and Lunions (when sub)? |
Yes. Based on in mind simulation, this change will not cause behavior change.
I thought excessive
Lunions is another story as the env save point doesn't make sense there. But I tried to make |
Looks like the speed up of save point added in this PR could be ignored after #48441. |
5e8a4cb
to
bead5c3
Compare
We'd better skip checked `equal_union` by set `state[i] = 1`
@nanosoldier |
Your package evaluation job has completed - possible new issues were detected. |
@nanosoldier |
Your package evaluation job has completed - possible new issues were detected. |
skip checked `equal_union` by set `state[i] = 1`
It turns out that #48221 increases the overhead of subtyping if
equal_unions
returnfalse
.The failing
equal_unions
would be re-subtyped during the nextexists_subtype
.This PR tries to avoid that by:
equal_unions
branch and settingstate[i] = 1
if it failed.equal_unions
.Some simple benchmark with
subtype
test itself as the reference