lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Leo Razoumov <slonik.az@gmail.com> writes:

> On 2009-11-06, Mike Pall <mikelu-0911@mike.de> wrote:
>> Please post current benchmark results vs. Matlab, if you have any.
>
> For whatever it is worth below is a comparison of LuaJIT-1 versus
> MATLAB-7.8.0 (February 2009 release) for a scalar tight loop
> performance.

[...]

> It seems that MATLAB Windows port is better optimized but it is still
> about 100 times slower than LuaJIT-1. The joke is that MATLAB has its
> own JIT since version 6.5 and JIT was enabled for these tests.
>
> Now you may ask how come that people put up with such a poor
> performance of the interpreter. The answer is multi-fold.

And mostly wrong.

Matlab is _known_ to suck at scalar code and nested loops.  Nobody uses
it in that manner for serious number crunching.  What you do is convert
your task into a matrix operation task.  At times that takes quite a bit
of ingenuity.  It helps that you can index a matric or vector using a
vector (and getting a vector), and the vectors of form a:b (a range) are
often optimized away into explicit code/loops.

There are tutorials and stuff around for maximizing Matlab performance.
And the main point is to avoid scalar operations.

-- 
David Kastrup