-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
Speed up replace
and canonicalize
by improving type stability
#2613
Conversation
3cbf139
to
14a17ba
Compare
By avoiding boxing in this function, SciMLStructures.replace becomes inferable
replace
and canonicalize
by improving type stabilityreplace
and canonicalize
by improving type stability
I fixed a few more cases and added tests with JET and I think that this should not increase compile times as the tuples are used for the number of types, so we don't expect a ridiculous number of types in the portions. |
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.
LGTM!
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
This PR attempts to fix #2608 by avoiding boxing and runtime dispatch. So far this works for the case of homogeneous parameters, but for heterogeneous ones, we end up iterating over a tuple of different types, which is unstable.