[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Uncommon OOP in Lua: right or wrong?
- From: "E. Toernig" <froese@...>
- Date: Mon, 27 Sep 2010 22:03:22 +0200
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.