lua-users home
lua-l archive

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

Eric Ries wrote:
> I would think that doing reference counting to catch the easy cases would
> solve most of the problem. It?s not like ref counting ever gives you any
> false positives (objects that should not be collected).

Why do you think that ref-counting is faster than a GC?  Most of the time
it's slower.  It takes more memory.  You still need a GC.  And the run-time
behaviour is also hard to predict.  I see no benefit...

> If you used ref
> counting to amortize the cost of freeing the simple garbage, the additional
> overhead of mark-and-sweep would only be high in cases where you have lots
> of circular data structures. Anyone in that category?

It happens more often than one may think.  I.e. every "back/parent-pointer"
creates a loop...

Ciao, ET.