[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Object or table?
- From: Lorenzo Donati <lorenzodonatibz@...>
- Date: Fri, 26 Aug 2011 16:48:17 +0200
On 26/08/2011 16.31, Stefan Reich wrote:
Ah. Thanks for the feedback on that! I am going for a simpler solution
as of now, which is just to test for presence of a metatable.
When I create Lua objects these days, I am lazy and just put the
methods in the table directly. I don't know if it was smarter to do it
any other way, but it's convenient and it works. Probably memory
efficiency would be the main reason to collect things in common
I'm not an expert of Lua internals, but I read somewhere that IIRC there
is also a cache for metatables. Thus adding methods to individual
objects may also impact performance. Not sure though.