lua-users home
lua-l archive

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


On 17 February 2011 20:25, Francesco Abbate <francesco.bbt@gmail.com> wrote:
> 2011/2/17 T T <t34www@googlemail.com>:
>> For N=1e8 I get 0.91sec with MATLAB and 0.68sec with LuaJIT-2.  Pretty
>> close I would say.

That got me thinking.  Mike, do you do some special optimization for 'a=a+1'?
I tried with 'a=a+sin(a)' instead and got only 20% difference between
MATLAB and LuaJIT.

> It seems that you know pretty well MATLAB. I was wondering what are
> its performances for ODE integration with a user supplied function. Do
> you know what kind of performances it can delivers in this case ?

That depends.  Since MATLAB doesn't optimize function calls very well,
callouts to small functions have a lot of overhead.  I ported your
rk4-unroll.lua to MATLAB and performance was terrible.  But for an ODE
of large dimension it will perform OK, because this overhead won't
matter that much.

However, speed is not MATLAB's real forte.  Documentation, well
integrated environment and kitchen and sink toolboxes are.  And I put
documentation first, because that's truly the best part of MATLAB.
You can learn from it like from a textbook, pretty amazing.  (But it
costs an arm and both legs too.)

Cheers,

Tomek