-
-
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
optimize field access when field types don't depend on parameters #21620
Conversation
Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @jrevels |
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.
We just need to make sure we never assume t->layout != NULL means leaftype
I think we should be good at this, since we already will fill in layout for other non-leaftypes such as bitstypes and singletons. I think we just need to be careful that we are aware that now T->layout
will apply to all subtypes of T. Perhaps worth putting a comment to that effect somewhere? (Since it means we are now depending on the type-system always returning correct answers for isleaftype)
This may need support from dump.c to avoid making copies of them in the sysimg, but this shouldn't be any worse then we do now.
src/datatype.c
Outdated
w->layout) { | ||
// if layout doesn't depend on type parameters, reuse it | ||
st->layout = w->layout; | ||
st->size =w->size; |
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.
formatting
also computes layout and shares it for all instantiations for such types
377fd17
to
f11dc15
Compare
would segfault when reaching the jl_datatype_nfields call
would segfault when reaching the jl_datatype_nfields call
would segfault when reaching the jl_datatype_nfields call
would segfault when reaching the jl_datatype_nfields call
…n field types don't depend on parameters fixes the bug in PR #21620 correctly
fix the bug in PR #21620 correctly
Example:
This change generates better code when we only know the type of something is
RemoteChannel
. It also computes a layout for thewrapper
of such types, and shares it for all instances. We just need to make sure we never assumet->layout != NULL
means leaftype, but I think we are pretty good about that. In any case this should be checked over carefully before merging this.@nanosoldier
runbenchmarks(ALL, vs = ":master")