lua-users home
lua-l archive

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

Mark Hamburg wrote:
> 5.2 is faster than 5.1.4. Sometimes by close to 20%. (This is on
> a benchmark test where I was looking at speed of some items in
> LuaJIT with regard to sequence iterators.)

Well, the bytecode for calling iterators changed somewhat.

But I suggest you recompile both the old and the new Lua with the
same compiler, using the same options and for the same
architecture (-m32 vs. -m64). Even minor changes to GCC can make
quite a difference when compiling the main interpreter loop.

That said, I see the following significant performance changes
between Lua 5.1.4 and Lua 5.2.0-work1 (negative means slower):

binarytrees  - 7%
chameneos    -18%
cheapconcr   -11%
cheapconcw   - 7%
fannkuch     - 8%
fasta        + 4%
mandelbrot   -14%
meteor       -10%
nsieve       + 4%
nsievebits   - 8%
spectralnorm -12%
sumfile      - 9%

So I'd say that Lua 5.2 is probably slower on average.

Another one of my micro-benchmarks to track regressions:

  local t = {}
  for i=1,100 do t[-i] = i end
  for j=1,1e6 do
    local x = 0
    for i=1,100 do x = x + t[-i] end

$ time lua-5.1.4 test.lua
$ time lua-5.2.0-work1 test.lua

This one got around 2.3x slower. :-/