-
-
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
typemap: attempt split on typenames also #35384
Conversation
src/typemap.c
Outdated
jl_datatype_t *dt = (jl_datatype_t*)t1; | ||
if ((abstract || !dt->abstract) && !jl_is_kind(t1)) | ||
return 0; | ||
return 1; |
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.
In this case we return NULL
above, so in what sense is that imprecise? Or maybe a better question is, when does this function differ from jl_type_extract_name() == NULL
?
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 suppose NULL is imprecise in the sense that we'll never consider asking this jl_type_extract_name_imprecise
question if the result was NULL?
src/typemap.c
Outdated
jl_datatype_t *dt = (jl_datatype_t*)t1; | ||
if ((abstract || !dt->abstract) && !jl_is_kind(t1)) | ||
return 0; | ||
return 1; |
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 suppose NULL is imprecise in the sense that we'll never consider asking this jl_type_extract_name_imprecise
question if the result was NULL?
@nanosoldier |
|
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan |
If the parameter is a TypeVar, it cnan have subtypes that might appear in the map itself and require a scan to locate.
This is an odd inversion in the specificity lattice where supertype(T) is more specific than T (and type-equal to T). Handle that here by consistently normalizing to the more specific copy, to avoid complications later.
… argument Previously, the TypeMap could only split on leaf types. Now it also has the ability to split on more abstract types. This helps gives types their own linear list to scan to find its constructors, instead of needing to search through all constructors.
f2f71e8
to
9bae8c4
Compare
This is a recreation of #16418, now working due to many changes in the meantime! In measurements, it appears to successfully shave significant time off
require
calls: