lua-users home
lua-l archive

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


Jerome, Petite, list,

>> I'm trying to load that 3M entries in to Lua table in memory faster
>> than I do it now.

Thanks for answers.

Sorry, it is 6 AM now, I'll try your solutions next evening.

For now, here is how to construct a better data sample (not tried, but
you should get a general idea). I guess those UUIDs are especially bad
for performance:

local uuid = require 'uuid' -- sudo luarocks install luuid

-- Loop here
io.write(
    "{",
    "qwertyui='", math.random(1, 50), "',",
    "asdfghjkl='", math.random(1, 2), "',",
    "zxcvbnmqwer='", uuid.new(), "'",
    "};\n"
  )

Thanks again,
Alexander.