Earlier quoted context omitted.
I'll admit I don't really know that much Julia and basically wrote naive MATLAB code (and I wanted to make it as close as possible to my python code): s=10000; a=ones(s,s); b=ones(s,s); c=zeros(s,s); tic(); for i in 1:s for j in 1:s c[i,j]=a[i,j]*b[i,j] end end toc(); Obviously in real code I'd simple write c=a.*b and get basically the same performance as numpy
Tarrosion is right, on my machine, putting the code inside a function is 10X faster, and then swapping the order of the loops gives another 10X improvement: function f(s) a=ones(s,s); b=ones(s,s); c=zeros(s,s); tic(); for j in 1:s for i in 1:s c[i,j]=a[i,j]*b[i,j] end end toc(); return c end Note that you also might have to run the function twice, because the first time JIT-compilation kicks in. Julia 0.5 also now au…
Guess I need to take some time at some point to sit down and actually learn 'proper' Julia.