EconForge / interpolation.py

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

WIP: try guvectorize #5

Open albop opened 8 years ago

albop commented 8 years ago

The functions which evaluate at one single point, can be vectorized using guvectorize. This is currently much faster than repeated calls of the evaluation function and almost as efficient as a manually inlined vectorized call. Also, one can take advantage of the new 'parallel' keyword, to use multiple cpus. Here are the timings for the usual experiment: 50x50x50 grid. Evaluation on 10^6 points:

Manual vectorization : 0.1056051254272461 GUVectorize : 0.10982108116149902 GUVectorize (parallel): 0.03372311592102051

Advantages: