[SciPy-Dev] default scipy fft performance
Fri Dec 21 09:53:20 CST 2012
On Fri, Dec 21, 2012 at 3:16 PM, Paul Anton Letnes
> 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
> 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.
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.
More information about the SciPy-Dev