lua-users home
lua-l archive

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


Getting a strange slow down when iterating a large table (>1 000 000 items) with the beta of LuaJIT 2

Lua 5.1.5
Total Time :    4:10:16
Item Time :    2:17:33
Text Time:    1:52:43

LuaJIT 1.1.8
Total Time :    3:20:10
Item Time :    2:06:21
Text Time:    1:13:49

LuaJIT 2.0.0-beta-git20120427
Total Time :    12:17:15
Item Time :    60:33
Text Time:    11:16:42

The 'Text Time' loop is basically of the form:

for phrase_id, texts in pairs(list) do    -- lots of entries
  if store_this(phrase_id) then
for lang_code, text in pairs(texts) do -- mostly one entry, some up to a dozen
      f:write(lang_code,text)
    end
  end
end

It doesn't appear to run slow when I look at it, so maybe some kind of garbage collection event is hitting whilst I'm away and holding things up for long periods of time (just a guess)

Not a show stopper for me, I can carry on with 1.1.8, but wanted to see if anybody could shed some light on it.

Scott