[Python-Dev] Alignment assumptions

Jack Jansen Jack.Jansen@oratrix.com
Thu, 28 Feb 2002 22:34:05 +0100

On donderdag, februari 28, 2002, at 07:57 , Tim Peters wrote:

> [David Abrahams]
>> A quick grep-find through the Python-2.2 sources reveals the 
>> following:
>> Include/dictobject.h:49: long aligner;
> This is in
> 	long	aligner;
> #endif
> and AFAIK nobody ever defines the symbol.  It's a cache-line 
> optimization
> gimmick, but is effectively a nop (except to waste memory) on 
> "almost all"
> machines.  IIRC, the author never measured any improvement by 
> using it (not
> surprising, since I believe almost all mallocs at least 8-byte 
> align now).
> I vote we delete it.

MacPython uses it. At the time it was put in it caused a 15% 
increase in Pystones because dictionary entries were aligned in 
cache lines. But: this was in the PPC 601 and 604 era, I must 
say that I've never tested whether it made any difference on G3 
and G4.

Put in a bug report in my name, and one day I'll get around to 
testing whether it still makes a difference on current hardware 
and rip it out if it doesn't.
- Jack Jansen        <Jack.Jansen@oratrix.com>        
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution -- 
Emma Goldman -