-
-
Notifications
You must be signed in to change notification settings - Fork 55
Description
Is your feature request related to a problem? Please describe.
In a performance critical part of my code, I'm evaluating multiple interpolations at the same t
location. Internally, this leads to lots of repeated calculations, since most of time in _interpolate
is spent on lines that only depend on t
and A.t
. Here's a VScode profiling, with the blue bars showing the time spent on each line.
Describe the solution you’d like
It would be good to have some standard method for evaluating multiple interpolations with the same A.t
grid at the same t
location simultaneously so that the most computationally intensive lines are not unnecessarily recomputed. Likewise I am taking derivatives at the same point, which again reuses things like get_idx()
, so having this standard method work with derivatives would be great as well.
Describe alternatives you’ve considered
- I could hack
_interpolate
myself, rewriting it for my specific case, but something more general would be appreciated. - I could also use the FiniteElementHermite.jl package that I wrote a while back, which does exactly what I'd want: First evaulate the value of common basis functions, then evaluate the specific interpolation with those bases: https://github.com/ProjectTorreyPines/FiniteElementHermite.jl/blob/0677b81c29240cb7824bd66476b424dbe4374667/src/hermite.jl#L345-L355