More embarrassing microbenchmars for D's GC.

Jarrett Billingsley kb3ctd2 at yahoo.com
Wed Jun 25 09:01:28 PDT 2008


"Michael Neumann" <mneumann at ntecs.de> wrote in message 
news:4862675F.3020603 at ntecs.de...

> Python used reference counting (~ Python 1.x) in the past, but I think
> they switched to a tracing garbage collector in 2.x. Using reference
> counting would explain the speedup IMHO. I think any mark and sweep
> garbage collector would be somewhat slow in the case of a linked list,
> as it has to traverse all elements to determine which memory is live and
> which can be freed (so it's O(n)). You'd be probably better off using a
> dynamic array here.

Maybe they just didn't change the API for backwards compatibility, but all 
the Python 2.x source I've seen used reference counting macros.  Maybe it's 
a hybrid memory manager?  Or maybe the macros are now no-ops ;) 





More information about the Digitalmars-d mailing list