-
Notifications
You must be signed in to change notification settings - Fork 2
Description
pyfftw_sdp is one of the fast methods in computing the sliding-dot-product of two arrays. It uses pyfftw, a wrapper around FFTW, the core algorithm behind MATLAB FFT. So, it is worthwhile to compare pyFFTW and MATLAB FFT to see how close they are to each other from performance perspective.
Note that MATLAB FFT does not support RFFT. Since RFFT is what we care about from sliding-dot-product's perspective, the following comparison is between pyfftw RFFT and MATLAB FFT. The following figures reflect the performance of pyFFTW (RFFT) w.r.t MATLAB (FFT). The timing scripts were executed on MATLAB online, and you can find the scripts attached at the bottom of this comment.
The functions, i.e. FFT or RFFT, are called 100 times for each case, and the average of the running time is recorded.
1-Thread pyFFTW (RFFT) vs 1-Thread MATLAB (FFT)
1-, 2-, 4-, 8- Threaded pyFFTW (RFFT) vs 8-Threaded MATLAB (FFT)
It is interesting to see that single-threaded pyFFTW RFFT outperforms MATLAB FFT in almost all cases even if it uses 8 threads.
To double check the performance, I increased the number of iterations per case from 100 to 10000. The maximum length of arrays is set to 2^20.
Scripts used for timing: