[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: custom "mark" function for userdata?
- From: Jerome Vuarand <jerome.vuarand@...>
- Date: Wed, 12 Aug 2009 12:04:18 +0200
2009/8/10 Joshua Haberman <joshua@reverberate.org>:
> My question is how to make GC work properly, but also efficiently.
> Unlike Ruby and Python, Lua does not (from what I can see) let userdata
> objects define their own "mark" function. This means that all objects
> that are reachable only through my container will get collected unless I
> do something to prevent that.
I think that this very kind of "feature" (I'd call it bloat) is what
makes Python or Ruby so slow compared to Lua. Keep in mind that using
a table environment for your userdata is still likely to keep your
special containers faster than they would in these languages. Tables
are the only structuring data type in Lua, why do you assume they are
not efficient when all the optimization efforts can be put into them ?