-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
widenconst
of a Const(::Type) can be quite slow
#44402
Comments
Refs #42596? |
Perhaps, but I think even a single type cache lookup can be quite problematic for these. I'm playing with just remembering the pointer in the types itself. |
In fact, as it stands, this issue might make #42596 problematic, because it might force computation of the |
I think that change might see widenconst return the kind instead, with the type-level information consistently tracked elsewhere instead |
Introduces a spearate lattice elements for tracking const Types that also stores the corresponding Type{} information, ensuring that this is only computed once and whenever possible is taken from an existing instance of it instead of recomputing it. Part of #44402
mostly fixes #44402 Co-authored-by: Jameson Nash <[email protected]>
mostly fixes #44402 Co-authored-by: Jameson Nash <[email protected]>
mostly fixes #44402 Co-authored-by: Jameson Nash <[email protected]>
mostly fixes #44402 Co-authored-by: Jameson Nash <[email protected]>
mostly fixes #44402 Co-authored-by: Jameson Nash <[email protected]>
1. Force inference to union-split the `widenconst` dispatch rather than joing through dynamic dispatch. 2. Avoid widenconst(::Const) in a hot path when not necessary. This got faster (#44402), but is not quite fast yet. Makes inference a few % faster.
1. Force inference to union-split the `widenconst` dispatch rather than joing through dynamic dispatch. 2. Avoid widenconst(::Const) in a hot path when not necessary. This got faster (#44402), but is not quite fast yet. Makes inference a few % faster.
1. Force inference to union-split the `widenconst` dispatch rather than joing through dynamic dispatch. 2. Avoid widenconst(::Const) in a hot path when not necessary. This got faster (#44402), but is not quite fast yet. Makes inference a few % faster.
Currently a lot of our code is written with the assumption that
widenconst(::Const)
is extremely fast. However, this is not true if the value inside the Const happens to be a Type. There, it can be very slow:The text was updated successfully, but these errors were encountered: