Benchmark MATLAB & Julia for Matrix Operations

The way you call manual measuring is incorrect.

Internally, timeit() calls the function many times and measures the time took for the whole process, not every individual call!

Just run open timeit, to see the code:

% timeit for Matlab:
for k = 1:num_outer_iterations
        tic(); % t1 = tic();...t = toc(t1) NOT used because not JIT-ed
	for p = 1:num_inner_iterations
	    output = f(); %#ok<NASGU>
	end
	runtimes(k) = toc();
end
t = median(runtimes) / num_inner_iterations;

I have another outer loop which calls timeit 4 times, and averages this median (https://github.com/juliamatlab/Julia-Matlab-Benchmark/blob/6e6e015efcce883f47e2942d8b60ed69315b265f/MatlabBench.m#L45)

The timeit itself calls the function multiple times and returns the median, then I calculate the average of different returns.

For example, inside timeit for matrix inversion, it runs 11*100 iterations and median is returned, and my 4 iterations wrap that to calculate the average of every 1100 iterations’ median. If I make the number of iterations around it 50, it becomes like 55000 iterations! while I explicitly stated Julia’s sample number as 700 in the code.

In contrast to your code, which measures every call and then calculates the median!

If you are suspicious about two different branches on my repository, you can run it and make a pull request. Check my Windows system’s specifications:

The performance of my system’s CPU is very good.

It is not about openBLAS or Intel. It is just a simple parallel processing concept that overhead for parallel processing should worth it!.