[Python-Dev] Object free lists
Bob Ippolito
bob at redivi.com
Tue Jun 15 22:58:43 EDT 2004
On Jun 15, 2004, at 10:52 PM, Tim Peters wrote:
> [Eric Huss]
>> The only problem I see with using pymalloc is that the objects won't
>> be
>> stored in memory in such a compact way.
>
> The difference can be large, because pymalloc aligns to 8-byte
> boundaries.
> So, e.g., on most boxes today a Python int object consumes 12 bytes,
> but
> would consume 16 if allocated with pymalloc. That's a 33% boost, and
> that
> can be significant for apps hanging on to lots of ints.
>
> OTOH, on most boxes there would be no real size difference for float
> objects.
The implementation of malloc in OS X always returns pointers aligned to
16-byte boundaries, so that the buffers can be reasonably used by
AltiVec instructions. Would there be a difference in this case? :)
-bob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2357 bytes
Desc: not available
Url : http://mail.python.org/pipermail/python-dev/attachments/20040615/5a82b77f/smime.bin
More information about the Python-Dev
mailing list