[Python-Dev] Re: The Dictionary Gem is polished!
Christian Tismer
tismer@tismer.com
Wed, 20 Dec 2000 18:31:00 +0200
Christian Tismer wrote:
...
When talking about left rotation, an error crept in. Sorry!
> We would then have:
>
> incr = ROTATE_LEFT(incr, 1)
> if (incr > mask):
> incr = incr ^ mp.ma_poly
If incr contains the high bits of the hash, then the
above must be replaced by
incr = ROTATE_LEFT(incr, 1)
if (incr & (mask+1)):
incr = incr ^ mp.ma_poly
or the multiplicative group is not guaranteed to be
generated, obviously.
This doesn't change my results, rotating right is still my choice.
ciao - chris
D:\crml_doc\platf\py>python dictest.py
N=1000
trips for strings old=293/9 new=302/7 new2=221/7 rot=272/8
trips for bad integers old=499500/999 new=13187/31 new2=999/1 rot=16982/27
trips for random integers old=339/9 new=337/7 new2=343/10 rot=342/8
trips for windows names old=230/5 new=207/7 new2=200/5 rot=225/6
N=2000
trips for strings old=1093/11 new=1109/10 new2=786/6 rot=1090/9
trips for bad integers old=0/0 new=26455/32 new2=1999/1 rot=33985/31
trips for random integers old=747/10 new=733/7 new2=734/7 rot=728/8
trips for windows names old=503/8 new=542/9 new2=564/6 rot=521/11
N=3000
trips for strings old=810/5 new=839/6 new2=609/5 rot=820/6
trips for bad integers old=0/0 new=38681/36 new2=2999/1 rot=50985/26
trips for random integers old=709/4 new=728/5 new2=767/5 rot=711/6
trips for windows names old=712/6 new=711/5 new2=691/5 rot=727/7
N=4000
trips for strings old=1850/9 new=1843/8 new2=1375/11 rot=1861/9
trips for bad integers old=0/0 new=52994/39 new2=3999/1 rot=67986/26
trips for random integers old=1584/9 new=1606/8 new2=1505/9 rot=1579/8
trips for windows names old=1449/8 new=1434/8 new2=1457/11 rot=1476/7
--
Christian Tismer :^) <mailto:tismer@tismer.com>
Mission Impossible 5oftware : Have a break! Take a ride on Python's
Kaunstr. 26 : *Starship* http://starship.python.net
14163 Berlin : PGP key -> http://wwwkeys.pgp.net
PGP Fingerprint E182 71C7 1A9D 66E9 9D15 D3CC D4D7 93E2 1FAE F6DF
where do you want to jump today? http://www.stackless.com