In our analysis we are using the photospline package from python to evaluate multiple splines with the same data (~20k points for each evaluation). Because splines are constructed with exactly the same knots, we could reuse centers values by calling the evaluate method. This results in ~50% faster evaluation in comparison to the evaluate_simple method (by not calling searchcenters, which does not seem to have optimised case when knots are distributed in a regular grid). See the screenshot for timings example:
@jvansanten , @martwo and I are going to implement this change in a branch, but it would be nice to know first whether it sounds okay or if you have any suggestion.
In our analysis we are using the photospline package from python to evaluate multiple splines with the same data (~20k points for each evaluation). Because splines are constructed with exactly the same knots, we could reuse
centers
values by calling theevaluate
method. This results in ~50% faster evaluation in comparison to theevaluate_simple
method (by not calling searchcenters, which does not seem to have optimised case when knots are distributed in a regular grid). See the screenshot for timings example:The current
evaluate
implementation https://github.com/icecube/photospline/blob/5ad5d0be526350804fb0e449255cf6589a36bffa/src/python/photosplinemodule.cpp#L534 does not seem to support numpy arrays, but it seems possible to add it based onevaluate_simple
implementation: https://github.com/icecube/photospline/blob/5ad5d0be526350804fb0e449255cf6589a36bffa/src/python/photosplinemodule.cpp#L633-L716@jvansanten , @martwo and I are going to implement this change in a branch, but it would be nice to know first whether it sounds okay or if you have any suggestion.