lua-users home
lua-l archive

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



On 8 Dec 2020, at 16:44, Egor Skriptunoff <egor.skriptunoff@gmail.com> wrote:

On Tue, Dec 8, 2020 at 7:30 PM Egor Skriptunoff wrote:
You're the new winner!

The winner of the benchmark.
Your approach would probably be impractical in real code due to the huge number of GC objects in a typical Lua program.
A full cycle of collecting garbage might be very slow.

Probably true, but in real code I would never use a table this way.  My solution was crafted purely to beat the benchmark.  Having said that, this approach doesn’t unduly increase the GC burden, so an application that is suffering due to GC overhead is likely to suffer anyway — weak tables have many more useful and legitimate uses.

Regards,
Chris

Chris Smith <space.dandy@icloud.com>