I did quickly some more test

for matlab it's the same time xomplex or real data array

nbp = 2^12;
M = rand(nbp);

tic
fft(M);
toc

Mp = exp(1i*M);

tic
fft(Mp);
toc

I got 
Elapsed time is 0.041000 seconds.
Elapsed time is 0.054349 seconds.

I'm on a different computer now so the time is different from previously


In julia I used this code to do the test
FFTW.set_num_threads(8)

nbp = 2^12;

M = rand(nbp,nbp)

@time rfft(M)

Mb = exp(im*M)

@time fft(Mb)


pfft=plan_fft(Mb);

@time pfft*Mb

rfft -> 0.060962 seconds (99 allocations: 128.067 MB, 1.76% gc time) 
fft -> 0.556133 seconds (73 allocations: 256.003 MB, 0.13% gc time)
plan_fft -> 0.487461 seconds (9 allocations: 256.000 MB, 1.45% gc time)


and in did the rfft is faster, same time as matlab. Strangely the plan_fft 
take the same time as a normal fft (but maybe it's normal and I don't 
understand how it's working)


I also did for a sizes of 2^12-1. In matlab the time was the same but in 
julia all the fft was around 0.1s


Anyway, thanks again for the answer. Now I have a better understanding of 
what's going on. I think matlab have some shenanigans in the background! 
hahahaha

Reply via email to