lua-users home
lua-l archive

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


On 11/6/12, spir <denis.spir@gmail.com> wrote:
> pack(unpack(a)) : array-table copy ?
> Is this a good idea?

This trick is only suitable for small arrays.
Array size should be less than 1000000 for vanilla Lua and less than
8000 for LuaJIT.
Amazingly, pack(unpack(a)) is almost two times faster than per-element
array copying for vanilla Lua.