wusunlab / leaf-pst

[WORK IN PROGRESS] Coupled Leaf Photosynthesis--Stomatal Conductance--Temperature (PST) Solver
MIT License
0 stars 0 forks source link

Manually optimize the evaluation of polynomial functions #2

Open wusunlab opened 4 years ago

wusunlab commented 4 years ago

These functions in Transfercoefs module use Math_helpers.polyval to evaluate polynomial functions:

This has been demonstrated to be less efficient in terms of time spent and allocations invoked than manually written polynomial expressions. Hard-code them for best performance, because the numerical coefficients would rarely need to be changed. If there is any change at all to these functions it would be likely on the interface side.