[ANNOUNCE] Garbage collection for Python

Michael Hudson mwh21 at cam.ac.uk
Thu Apr 13 05:37:59 EDT 2000


"Neil Schemenauer" <nascheme at enme.ucalgary.ca> writes:

> Garbage collection for Python:
> 
>     http://www.enme.ucalgary.ca/~nascheme/python/gc.html
> 
> I think I have all of the wrinkles ironed out of this patch.
> Reference cycles involving lists, tuples, instances, classes,
> dictionaries, and functions are found.  Instances with __del__
> methods are handled in a sane way.  It is easy to add GC support
> to new types.  GC enabled Python is binary compatible with
> regular Python.  

Woohoo!

> Generational collection works (currently three generations).  The
> overhead measured by pybench is less than 1 percent and is not
> measurable with pystone (on my machine).  Virually all extension
> modules should work unchanged (I had to modify new and cPickle in
> the standard distribution).  A new module called gc is available
> for tuning the collector and setting debugging options.

And in some cases it can be faster; eg. bytecodehacks does a lot of
scary hackery to avoid producing cycles, and if I take the hackery out
and run it under a patched python, it goes quicker (test case in 7.2s
vs 12.5s, so not to be sniffed at).

> The patch is against the current CVS version of Python.  If
> enough people ask for a patch against the stable version of
> Python I will make one.  Please send comments and bug reports.

Haven't found a problem yet.


To someone who might know: what hope is there for this to go into 1.6?


It would be, in my opinion, be a really really really good thing; for
one thing it would help in language wars...

hopeful-ly y'rs
Michael

-- 
  it's not that perl programmers are idiots, it's that the language
  rewards idiotic behavior in a  way that no other language or tool 
  has ever done                        -- Erik Naggum, comp.lang.lisp



More information about the Python-list mailing list