[SciPy-Dev] default scipy fft performance

Sturla Molden sturla at molden.no
Fri Dec 21 11:26:07 EST 2012


Den 21. des. 2012 kl. 16:53 skrev David Cournapeau <cournape at gmail.com>:

> 
> But you could use e.g. pyfftw that will give you a better wrapper that
> scipy ever had for FFTW.
> 
> The difference in speed is not unexpected: the fft in numpy is there
> for historical reasons and backward compatibility. Unless you have a
> very good reason not to use it, you should be using scipy.fftpack
> instead of numpy.fft when you can depend on scipy.
> 

Enthought is a good reason, as numpy.fft will use MKL.

Another good reason is that the wrapper for numpy.fft is written in a way that makes it easy to release the GIL (no global states in C land), whereas scipy.fftpack is not reentrant. Sometimes it can be nice to do multiple FFTs in parallel threads. (I might try to re-post a PR to NumPy for releasing the GIL in numpy.fft again, unless it is taken care of now, but last time nobody cared to review it.)

Sturla






More information about the SciPy-Dev mailing list