Open dsfulf opened 4 years ago
Thank you dsfulf. Now that I have some more time (last term was crazy), I'll ask my graduate students to implement this.
Thank you for contributing to geostatspy, Michael
It is certainly worth it. I numba
fied parts of my Python code and the speedup is indeed in the order of the hundreds.
Given that a lot of
geostatspy
is written in pure Python, I would like to offer the suggestion that some minor refactoring be performed to enable addingnumba
@njit
decorators to compute-intensive functions.For example, taking the
geostatspy.varmapv
function, we can split the mainpulation of thepandas.DataFrame
object from the numerical code:After refactoring:
Timing of the current implementation is 580 ms on my machine, while the numba decorated version is is 2.02 ms
For scaling up to several thousand data points, a factor of over 100x is considerable!
Further optimization can be performed for functions that are parallelizable, letting
numba
release the GIL and optimize the function for multi-processing / multi-threading.