Fw: [pypy-dev] Re: [ann] Minimal Python project
Guido van Rossum
guido at python.org
Thu Jan 16 18:17:00 CET 2003
> From: "Michael Hudson" <mwh at python.net>
> > > integer in the range [-2**30,2**30-1] would be represented by their bit
> > > patterns shifted left by 1 bit
> > >
> > > all other objects would be boxed, and the address left shifted by 1 and ORed
> > > with 1.
> > I seem to recall someone tried that with python quite recently and
> > found it was a pessimization (search python-dev, I guess).
> > I'm not sure that's what Paul meant, though.
> he wrote tagged representation, and there was an e.g. in front of the example
> above, I don't claim it does wonder, even less together with psyco or with
> reference counting.
We did something like this in ABC 20 years ago and IMO it was a recipe
for disaster. We kept finding more places where we had to check
pointers before dereferencing them. Admitted, the scheme proposed
here may not have the same problem because all pointers are shifted
too. But I seem to recall that the slight gain in memory usage wasn't
worth the code complexity. Caching 100 small ints probably goes a
long way for typical programs.
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Pypy-dev