[Python-3000] Free list for small longs

Brett Cannon brett at python.org
Wed Feb 6 00:05:29 CET 2008


On Feb 5, 2008 2:30 PM, "Martin v. Löwis" <martin at v.loewis.de> 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?
>
> We don't have a free list, but a cache for them, and only for numbers
> between -5 and +256. Christian proposes a freelist, similar to the
> special allocate in 2.x.

Gotcha.

Well, I am a little leery of another free list. I personally don't
love the fact that there are various caches and free lists laying
about in the code without a central place to turn them off or clear
them (or at least list them in a comment somewhere). And the problem
with the free lists that the caches don't have is that they assume
everyone gets a performance perk from them when there is a chance no
one will ever touch a thing in the free lists.

-Brett


More information about the Python-3000 mailing list