I tried in in Matlab R2014a and Julia 0.3.10 on an 2.5 GHZ i5 and the difference was much smaller:
22 seconds for Julia, 19 for Matlab Also, I tried it in local and global scope and the difference wasn't more than one or two seconds El domingo, 12 de julio de 2015, 13:57:40 (UTC-5), Milan Bouchet-Valat escribió: > > Le dimanche 12 juillet 2015 à 11:38 -0700, John Myles White a écrit : > > http://julia.readthedocs.org/en/release-0.3/manual/performance-tips/ > I don't think running the code in the global scope is the problem here: > most of the computing time is probably in BLAS anyway. I think MATLAB > uses Intel MKL while Julia uses OpenBLAS, and maybe on that particular > problem and with your particular machine the former is significantly > faster. > > If you really need this 2.3 factor you could try building Julia with > MKL. See https://github.com/JuliaLang/julia/#intel-compilers-and-math > -kernel-library-mkl > <https://github.com/JuliaLang/julia/#intel-compilers-and-math-kernel-library-mkl> > > > > Regards > > > > On Sunday, July 12, 2015 at 8:33:56 PM UTC+2, Evgeni Bezus wrote: > > > Hi all, > > > > > > I am a Julia novice and I am considering it as a potential > > > alternative to MATLAB. > > > My field is computational nanophotonics and the main numerical > > > technique that I use involves multiple solution of the > > > eigenvalue/eigenvector problem for dense matrices with size of > > > about 1000*1000 (more or less). > > > I tried to run the following nearly equivalent code in Julia and in > > > MATLAB: > > > > > > Julia code: > > > > > > n = 1000 > > > M = rand(n, n) > > > F = eigfact(M) > > > tic() > > > for i = 1:10 > > > F = eigfact(M) > > > end > > > toc() > > > > > > > > > MATLAB code: > > > > > > n = 1000; > > > M = rand(n, n); > > > [D, V] = eig(M); > > > tic; > > > for i = 1:10 > > > [D, V] = eig(M); > > > end > > > toc > > > > > > It turns out that MATLAB's eig() runs nearly 2.3 times faster than > > > eig() or eigfact() in Julia. On the machine available to me right > > > now (relatively old Core i5 laptop) the average time for MATLAB is > > > of about 37 seconds, while the mean Julia time is of about 85 > > > seconds. I use MATLAB R2010b and Julia 0.3.7 (i tried to run the > > > code both in Juno and in a REPL session and obtained nearly > > > identical results). > > > > > > Is there anything that I'm doing wrong? > > > > > > Best regards, > > > Evgeni > > > >