EconForge / interpolation.py

BSD 2-Clause "Simplified" License
125 stars 35 forks source link

WIP: Added experimental support for JIT classes. #4

Closed albop closed 5 years ago

albop commented 8 years ago

The file misc/try_jit_classes has one example of a spline object using numba's jit classes. sp = Spline3D(a,b,orders,values)

Current limitations:

As for the performance aspect (which can still improve), it is not bad at all. On a 50x50x50 grid evaluating on 10^6 points:

JIT class (repeated call): 0.309826135635376         # repeated calls to JIT class
No class (repeated call): 0.23068761825561523     # direct repeated calls to interp. routine
Vectorized version: 0.10867524147033691             # vectorized function (with no memory allocation)
Scipy (linear): 0.692845344543457                          # (!?? is it the right way to proceed ?)