[Python-3000] Free list for small longs

Christian Heimes lists at cheimes.de
Tue Feb 5 21:31:17 CET 2008


Brett Cannon wrote:
> I think Christian means single digit integers. But I thought we
> already did this for positive numbers? So is the proposal to also
> cover negative numbers?

Ne, we don't use a free list for longs. In the 2.x series floats and
ints are allocated in blocks of 1000 objects. The 3.x series uses the
approach for floats only. Longs are always allocated with a free list
unless the value is in between -5 and +256. These longs are statically
allocated using an array.

> And obviously having a single loop that explicitly tests the
> optimization is not exactly indicative of real-world use. =)

Damn, you got me  ;)

Christian




More information about the Python-3000 mailing list