Earlier quoted context omitted.
Could you post the Julia code? Unfortunately, you do have to make sure that the types are correctly inferred by the compiler in high-performance loops. Or maybe you used a global. http://docs.julialang.org/en/release-0.4/manual/performance-...
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
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 automatically devectorizes some code (eg. x = a .* b .+ c) so that you don't have to write explicit loops to get performance benefits.