lua-users home
lua-l archive

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


Jonathan Castello wrote:
>
> You can mitigate the cost a little by creating the functions
> themselves outside the constructor function, and creating functions
> inside that simply call those functions.

Just slows things down.

> You save the cost of recreating each function's bytecode by saving
> the functions in one place;

The bytecode is only created once when loading the chunk.  Creating a
new closure does *not* copy or even recreate the bytecode.

Ciao, ET.