[Python-Dev] Optimization of the Year

Tim Peters tim.one at comcast.net
Tue Feb 10 11:26:55 EST 2004


[Tim]
> ...
> Guido explained it:  we can add one 4-byte field to the list object
> header on a 32-bit box for free now, but adding two grows every list
> object by 8 bytes.

To be more precise, we can add one 4-byte field for free on 32-bit boxes
under compilers where "long double" has 4-byte alignment.  We can't add
anything for free under compilers where "long double" has 8-byte alignment;
this includes Microsoft's compiler, alas.  (The gc header is forced to long
double alignment via a union trick, and that makes the gc header consume 16
bytes (4 of them unused padding) under MSVC.)




More information about the Python-Dev mailing list