[SciPy-Dev] default scipy fft performance
Fri Dec 21 10:14:16 CST 2012
Den 21. des. 2012 kl. 16:16 skrev Paul Anton Letnes <email@example.com>:
> Dear Scipy devs,
> 1) thanks for doing a great job in general!
> 2) Why is there a huge performance difference between scipy.fft and scipy.fftpack.fft? It apperars that scipy.fft == numpy.fft:
> In : import numpy as np
> In : from scipy import fft
> In : from scipy import fftpack
> In : d = np.linspace(0, 1e3, 1e7)
> In : %timeit np.fft.fft(d)
> 1 loops, best of 3: 1.29 s per loop
> In : %timeit fft(d)
> 1 loops, best of 3: 1.3 s per loop
> In : %timeit fftpack.fft(d)
> 1 loops, best of 3: 651 ms per loop
They are not the same. SciPy fftpack is fortran FFTPACK. NumPy uses the C coded fftpack-lite. The wrappers are also different, and SciPy can modify arrays inplace.
> 3) On a related note - what's the best performing python fft library/wrapper out there? I take it from some google research I did that e.g. fftw cannot be used due to the GPL licence.
If you use EPD, numpy.fft will use MKL. That will be about as fast as it gets.
FFTW is GPL, but you can use it if GPL is ok. It usually is: If you can use Linux, you can use FFTW as well.
ACML is also an option. It is not as fast as MKL or FFTW, but faster than FFTPACK.
You can also call MKL, ACML or FFTW directly using Cython, f2py or ctypes.
There is also a TVirtualFFT in ROOT, that uses FFTW. ROOT has a Python interface as well.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-Dev