lua-users home
lua-l archive

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


Egor Skriptunoff wrote on 11/24/2020 9:58 AM:
On Tue, Nov 24, 2020 at 6:46 PM Norman Ramsey wrote:
why wouldn't you simply allocate a fresh table?
Why try to reuse an old one?

The reusing is significantly faster:

Also, I should point out that in the various commercial games I have shipped, we pre-allocate as much as we can and reuse the already allocated data structures whenever possible to avoid the memory manager fragmenting or the garbage collection kicking in when not needed.

-Josh