Python and Boehm-Demers GC, I have code.

Neil Schemenauer nascheme at ucalgary.ca
Sat Jul 17 18:19:21 EDT 1999


On Sat, Jul 17, 1999 at 06:00:24PM +0200, Christian Tismer wrote:
> Neil Schemenauer wrote:
> ...
> > With some tuning maybe the gc version of Python will perform
> > better than the regular version.
> 
> I believe you will need to keep the RC as well, since at
> the moment, I think this gives more locality than GC,
> as Tim mentioned already.

It is my intention to leave the RCing alone.  My previous
ambition to remove it was misguided.  By tuning I meant doing
things like reducing how often the collector gets called.  Since
RC should take care of almost everything the collector should
very infrequently.  Then again, premature optimization is the
root of all programming evil.  I will concentrate on making
things work right now.

> If you can manage to make it rock solid, I would perhaps
> like to bundle it with stackless Python. Although, the
> collector which Guido proposed a while ago could perform
> even better, so I'm still a bit undecided.

I don't know about rock solid but it is running pretty well for
me now.  I fixed the problem with the tkinter callbacks and I can
now run Idle and Grail with no problems.  All regression tests
pass.  I will try to beat on it for a few days and see what what
breaks.  I haven't fixed all the extension modules yet.  There is
trouble if PyMem_* and malloc and friends are mixed.  I suspect
that many extension modules do this (including some of mine).  So
far I had to fix readline, regex, re, and some of the Python
internals.  I have sent Guido a patch.

Are you familiar with the (theoretically) copying garbage
collector for Python?  I can't find the name of the guy who wrote
it.  I think it would be interesting to integrate this collector
with your stackless Python.  That would remove the need for
keeping the separate GC stack (I think).  pybench shows Python
with this collector to be 68% slower than Python 1.5.1.  It
should be faster without the GC stack but it will probably still
be slower than regular Python.

I have a new version of the patch available at:


	http://www.acs.ucalgary.ca/~nascheme/python/gc.html


I will probably compile some Windows binaries (for people on
compiler challanged systems).  Hopefully people can try it out
and give me some feedback.


    Neil




More information about the Python-list mailing list