>> B=randn(100);
>> tic, for k=1:10000, svd(B); end, t=toc/10000
t =
5.541419457000000e-04
(The results don’t change much for different random matrices.) So Julia is taking nearly 20x as long to compute the singular values. Have I overlooked something?
Unfortunately we’re comparing apples to oragnes here: Julia’s svdvals vs Matlab’s svd. (Matlab doesn’t have an equivalent to svdvals AFAIK). Julia’s svdfact is 6x slower than Matlab’s svd on my machine.
I think the single output argument of Matlab svd is equivalent to Julia’s svdvals (I don’t know enough Matlab to say which is called with no arguments).
That doesn’t show the equivalence between MATLAB’s svd() with one output to Julia’s svdvals().
You need to show that in case you call MATLAB svd() with 2 output parameter the run time changes.
This will imply that in case of one output MATLAB is doing something optimized for getting the Singular Values only.
Took the advice of @RoyiAvital and @ChrisRackauckas to download JuliaPro with MKL. Timing went down to about 500 μs, which is completely on par with my MATLAB results.
Funny, I always just assumed the “Pro” meant $$. So I went with more DYI, except not enough DYI to build from source…