[SciPy-dev] scipy.fft module slow for complex inputs when linked to fftw3

David Cournapeau david at ar.media.kyoto-u.ac.jp
Fri Aug 18 03:32:14 CDT 2006

Hi there,

    I noticed recently that when using the fft module of scipy, it is 
much slower (5-10 folds) than numpy for complex inputs (only in the 1d 
case) when linking to fftw3. This problem is reported on the ticket #1 
for scipy : http://projects.scipy.org/scipy/scipy/ticket/1

I am not sure, because the code is a bit difficult to read, but it looks 
like in the case of complex input + fftw3, the plan is always recomputed 
for each call to zfft (file:zfft.c), whereas in the real case or in the 
complexe case + fftw2, the function drfft(file:drfft.c), called from 
zrfft (file:zrfft.c) is calling a plan which is cached. I am trying to 
see how the caching is done, but I am not sure I will have the time to 
make it work for fftw3.


P.S: I am wondering if there is a reason why the code is written with 
all those #ifdef ? Because it makes the hacking of the module quite 
difficult. Why not implementing each function for each fft library, and 
wraps them around in the header files ? Is is just a time constraint, or 
is there another reason ?

More information about the Scipy-dev mailing list