I am considering speeding up the log-sum-exp operation (using the max trick operation) from Python code. I use Python 2.7 for Windows 8. I have compiled a comparison of implementations using the Numpy, Scipy, Numba, Cython, Weave, and numexpr functions, which can be viewed here in nbviewer .
I expected my versions of Cython and Weave to be the fastest, as they will be closest to their own code. But in reality they are slower than other versions.
How to make these versions as fast as possible?
Edit: take an initial notepad, add a max trick in all methods to make the comparison less simple, and closer to my real need.
python numpy cython
Sebastien
source share