Python's garbage collection was Re: Python reliability

Paul Rubin http
Thu Oct 13 11:58:01 CEST 2005


"Diez B. Roggisch" <deets at nospam.web.de> writes:
> That particular implementation used 3 or 4 tag-bits. Of course you are
> right that nowadays python won't notice the difference, as larger nums
> get implicitely converted to a suitable representation. But then the
> efficiency goes away... Basically I think that trying to come up with
> all sorts of optimizations for rather marginal problems (number
> crunching should be - if a python domain at all - done using Numarray)

I don't think it's necessarily marginal.  Tagged ints can be kept in
registers, which means that even the simplest code that does stuff
with small integers becomes a lot more streamlined, easing the load on
both the Python GC and the cpu's memory cache.  Right now with the
bytecode interpreter, it probably doesn't matter, but with Pypy
generating native machine code, this kind of thing can make a real
difference.



More information about the Python-list mailing list