Fw: [pypy-dev] Re: [ann] Minimal Python project
From: "Michael Hudson" <mwh@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.
From: "Michael Hudson" <mwh@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/)
participants (2)
-
Guido van Rossum -
Samuele Pedroni