[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index] - Subject: Re: LuaJIT and large tables
- From: Mike Pall <mikelu-1003@...>
- Date: Sun, 7 Mar 2010 22:53:11 +0100
Sean Conner wrote: > Lua itself limits a function to around 2^17 or 2^18 constants, so I worked > around that limit. Is the 65,536 limit in LuaJIT a bug, or a design > constaint? LuaJIT has different limits and different design constraints. For a single table that consists only of constants there's effectively no limit (memory is the limit). But your test case has lots of small, nested tables. Every individual table only occupies a single constant slot (and not one for each of its keys/values). But there are too many of these tables to keep them in a single function. The short term solution is to split the table construction into smaller pieces, wrapped into individual functions. The long term solution would be to add a workaround for these limits to LuaJIT. But I'm not sure about the best way, yet. > [2] The Lua bug it exposed has since been fixed > http://www.lua.org/bugs.html#5.1.4-6 This problem is not present in LuaJIT 2.0. --Mike