I'm just curious so I looked into it. I'm just, familiar, with what FFT, DCT, IDCT and Fourier transform is for.. but not really that much and my math is fading..
I got similar numbers (I'm on 0.3.11) to you and then I tried with (as I recall power of twos are what you should be using): r=rand(2^20) Then numbers are much more closer, but still a gap. You can look at the code and edit! with edit(FFTW.r2r) I'm not sure the former or latter numbers, are NOT what should be expected (or at least that a slowdown is introduced by Julia). See here: http://www.fftw.org/doc/1d-Real_002deven-DFTs-_0028DCTs_0029.html That is the (GPL) library that does the heavy lifting (not coded in Julia), and there are the equations behind what you are doing. You could do something like @profile FFTW.r2r(r,FFTW.REDFT00) And look into how the profiler works (to see the results), but I doubt you'll see much interesting if it only shows the Julia side.. By just scanning the code I code like this: execute(precision::fftwTypeDouble, plan) = ccall((:fftw_execute,libfftw), Void, (Ptr{Void},), plan) That I assume does all the work (e.g. the FFTW library that it calls). -- Palli. On Tuesday, September 22, 2015 at 10:52:10 AM UTC, Sheehan Olver wrote: > > This is in 0.4rc2 on OS X. > > On Tuesday, September 22, 2015 at 8:51:50 PM UTC+10, Sheehan Olver wrote: >> >> I get the following timings with the various FFTW routines, where I ran >> each line multiple times to make sure it was accurate. Why are REDFT00 and >> RODFT00 almost 10x slower? >> >> >> r=rand(100000) >> @time FFTW.r2r(r,FFTW.REDFT00) #0.26s >> @time FFTW.r2r(r,FFTW.REDFT01) #0.0033s >> @time FFTW.r2r(r,FFTW.REDFT10) #0.0035s >> @time FFTW.r2r(r,FFTW.REDFT11) #0.0033s >> @time FFTW.r2r(r,FFTW.RODFT00) #0.017s >> @time FFTW.r2r(r,FFTW.RODFT01) #0.0035s >> @time FFTW.r2r(r,FFTW.RODFT10) #0.0035s >> @time FFTW.r2r(r,FFTW.RODFT11) #0.0035s >> @time fft(r) #0.0033s >> >>
