Hello everyone,

I am working on a Julia code which is a brutal copy of a Matlab code and 
found out that the Julia code is slower..... 

So I did some naive benchmark and found strange results... 

I did look for solution on The Internets but... I found nothing usefull 
that why I'm asking the question here.

Maybe someone have an idea of why the Julia code is slower than MATLAB? 
(because the official benchmark say that it should be quicker )

PS: I know that it's a bit of a recurrent question.... 

The codes are 

Julia code 

nbp = 2^12;

m = rand(nbp,nbp);
a = 0.0;
Mr = zeros(nbp,nbp);

tic()
for k = 1:nbp
    for kk = 1:nbp

    Mr[k,kk] = m[k,kk]*m[k,kk];

    end
end
toc()


Elapsed time: 7.481011275 seconds


MATLAB code

nbp = 2^12;

m = rand(nbp,nbp);
a = 0.0;
Mr = zeros(nbp,nbp);


tic
for k = 1:nbp
    for kk = 1:nbp
   
    Mr(k,kk) =m(k,kk)*m(k,kk);
    
    end
end
toc


Elapsed time is 0.618451 seconds.

Reply via email to