[Python-Dev] PEP 393 review (original) (raw)

Guido van Rossum guido at python.org
Thu Aug 25 23:55:22 CEST 2011


On Thu, Aug 25, 2011 at 1:24 AM, "Martin v. Löwis" <martin at v.loewis.de> wrote:

With this PEP, the unicode object overhead grows to 10 pointer-sized words (including PyObjectHEAD), that's 80 bytes on a 64-bit machine. Does it have any adverse effects? If I count correctly, it's only three additional words (compared to 3.2): four new ones, minus one that is removed. In addition, it drops a memory block. Assuming a malloc overhead of two pointers per malloc block, we get one additional pointer. [...]

But strings are allocated via PyObject_Malloc(), i.e. the custom arena-based allocator -- isn't its overhead (for small objects) less than 2 pointers per block?

-- --Guido van Rossum (python.org/~guido)



More information about the Python-Dev mailing list