-
-
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
polymorphic specializations field: either svec or value #49071
Conversation
Attempt an experiment: remove arrays that only have one value. Seems to save about 0.8% (1MB) in the sysimg, since we were rather significantly over-sizing these (about 16 slots initialized) before. Also a small lookup-failure optimization for the hashing-failed case to avoid duplicated work.
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.
Can we make m.specializations::Union{SingleSpec, SimpleVector}
and define iterate
for SingleSpec
to land this as non-breaking change? It would probably better to run pkgeval to assess the impact of this change on the ecosystem.
I don't think that is worthwhile. I have made significant changes to this field in most releases (and likely will again), so anyone depending on it without going through the API is already in trouble. |
What is the API? I seem to be guilty of not using it: https://juliahub.com/ui/Search?type=code&q=.specializations&w=true The MethodAnalysis package defines what I'd call a real API: |
AFAIK, it is only defined as |
OK, I was trying to avoid depending on compiler internals but perhaps that's better in this case. |
There's more: MethodAnalysis.jl can traverse the entire system (or specific modules) and collect all the existing MethodInstances. Is there an approved API for this? I riffed off of |
MethodInstance is sufficiently internal, that it does not really have a usable API except for that query |
Ok. Assuming this is sticking around, I'll adapt to the new approach. |
If you do want to add an API for that in Base somewhere as well, I will try to maintain it |
Will do. I think it works well as a |
I'm both using Tim's MethodAnalysis and occasionally index into @timholy would it make sense to open a ticket on MethodAnalysis so that interested parties could get a notification when support for nightly will be restored? |
It's currently irrepairable due to JuliaLang/julia#49071
It's currently irrepairable due to JuliaLang/julia#49071
There have been longstanding reasons to want an API for extracting all extant specializations of a method, but this is even more true after #49071.
This updates for JuliaLang/julia#49071. I added this test, so I thought I should fix it.
* adjust to JuliaLang/julia#49071 * adjust to JuliaLang/julia#49113 After JuliaLang/julia#49113, `src.slot[names|types|flags]` may be resized by the optimization pipeline, so we have to make sure to store our own copies of them to keep the pre-optimization state of `CodeInfo`.
Already fixed (v0.4.12) |
@timholy thank you! |
There have been longstanding reasons to want an API for extracting all extant specializations of a method, but this is even more true after #49071. Co-authored-by: Shuhei Kadowaki <[email protected]> Co-authored-by: Jameson Nash <[email protected]>
There have been longstanding reasons to want an API for extracting all extant specializations of a method, but this is even more true after JuliaLang#49071. Co-authored-by: Shuhei Kadowaki <[email protected]> Co-authored-by: Jameson Nash <[email protected]>
Attempt an experiment: remove arrays that only have one value. Seems to save about 0.8% (1MB) in the sysimg, since we were rather significantly over-sizing these (about 16 slots initialized) before.
Also a small lookup-failure optimization for the hashing-failed case to avoid duplicated work.