[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: pack(unpack(a)) : array-table copy ?
- From: Egor Skriptunoff <egor.skriptunoff@...>
- Date: Tue, 6 Nov 2012 18:46:43 +0300
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.