[Python-Dev] int/float freelists vs pymalloc
Andrew MacIntyre
andymac at bullseye.apana.org.au
Wed Feb 20 13:56:21 CET 2008
Andrew MacIntyre wrote:
> M.-A. Lemburg wrote:
>> If we're down to voting, here's my vote:
>>
>> +1 on removing the freelists from ints and floats, but not the
>> small int sharing optimization
>>
>> +1 on focusing on improving pymalloc to handle int and float
>> object allocations even better
>>
>> -1 on changing the freelist implementations to use pymalloc for
>> allocation of the freelist members instead of malloc, since
>> this would potentially lead to pools (and arenas) being held alive
>> by just a few objects - in the worst case a whole arena (256kB)
>> for just one int object (14 bytes on 32bit platforms).
>>
>> Eventually, all freelists should be removed, unless there's a
>> significant performance loss.
>
> Sigh... things are never as simple as they seem...
>
> Prompted by your comment about the small int sharing, which I was aware
> of and was not addressing because I was assuming that its value was
> unimpeachable, I've been doing some more testing with this and the
> freelists.
>
> I don't have time to write it up tonight, but I've concluded that my
> original test scripts and other tests weren't showing the real
> performance of the various approaches. Platform (architecture, compiler
> etc) oddities & differences complicate life too...
I've now written up my testing and attached the write-up to issue 2039
(http://bugs.python.org/issue2039).
--
-------------------------------------------------------------------------
Andrew I MacIntyre "These thoughts are mine alone..."
E-mail: andymac at bullseye.apana.org.au (pref) | Snail: PO Box 370
andymac at pcug.org.au (alt) | Belconnen ACT 2616
Web: http://www.andymac.org/ | Australia
More information about the Python-Dev
mailing list