lua-users home
lua-l archive

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


On 20/12/2012, at 10:57 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:

> For example, on my system (local 32-bit Ubuntu build from the latest
> source releases) `while` was fastest, at about 0.5 seconds and ipairs
> slowest at about 1.3 seconds.
> 
> I replaced the line
> 
>    sum = sum + j + v
> 
> by
> 
>    sum = tostring(v):upper()
> 
> and the time jumps to about 15 seconds.  On LuaJIT it jumped
> from 0.3 to to 136 seconds.  I could have got myself a mug of
> coffee.  Bye-bye to the conventional wisdom that LuaJIT is
> faster than PUC-Rio!

I'm afraid this test offers no evidence to support that.  It was not intended to compare Lua and LuaJIT, s0orry if you got that impression.  In order to get run times of the order of a second, unless you modified it, the test does ten times as many iterations for LuaJIT as it does for PUC Lua (see line 3).

If I make your modification and run for the same number of iterations, I find that on my machine LuaJIT is slightly faster.