[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Load large amount of data fast
- From: Alexander Gladysh <agladysh@...>
- Date: Sun, 17 Oct 2010 04:26:08 +0400
On Sun, Oct 17, 2010 at 03:47, Luis Carvalho <lexcarvalho@gmail.com> wrote:
>> Apologies for a lazy question, I have not done my own homework.
>> I've got a large file (3M entries, 250 MB) with data.
>> Each entry is one line with a small Lua table:
>> { foo = 1; bar = 2; baz = 'text' };
> I'm almost sure I'm missing something here, but since each line is a table, is
> there anything wrong with this?
> local load_huge_table_list = function (filename)
> local f = assert(io.open(filename))
> local s = "return {" .. f:read"*a" .. "}"
> f:close()
> return assert(loadstring(s))()
> end
There is a limit of constants per chunk, you'll hit it.
Alexander.