[Python-Dev] String hash function multiplier

Andrew MacIntyre andymac at bullseye.apana.org.au
Wed Apr 14 09:34:13 EDT 2004

On Wed, 14 Apr 2004, Jeff Epler wrote:

> Pentium IV, 2.4GHz:
> -O2 -mcpu=i386       -DMUL=100003         1.56


> -O2 -mcpu=pentium4   -DMUL=100003         0.63


> With AMD CPUs, the current multiplier beats both the new multipler and
> the version expressed as shifts and adds/subtracts:


> On an Athlon XP 2600+:
> -O2 -mcpu=i386       -DMUL=100003         0.95


> -O2 -mcpu=athlon-xp  -DMUL=100003         0.43 *


> Long-at-a-time hash, Duron, 1GHz:
> -O2 -march=athlon-tbird -DMUL=100003         0.35

Ummm...  are you showing what you think you're showing here?  As I recall,
i386 gcc uses -mcpu and -march differently to most other architectures:
- -mcpu just sets scheduling parameters, but not instruction set;
- -march sets the instruction set.

So most of the timings you show are for the i386 instruction set, but with
different scheduling.  The exception is the long-at-a-time hash.

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