On 9/4/07, <b class="gmail_sendername">Thomas Hunger</b> <<a href="mailto:hto@arcor.de">hto@arcor.de</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Hello,<br><br>I don't know much about python internals, so the following might be<br>bogus:<br><br>I replaced unicode_hash and string_hash with the hash function from<br>here: <a href="http://www.azillionmonkeys.com/qed/hash.html">
http://www.azillionmonkeys.com/qed/hash.html</a>.<br><br>Then I ran the following micro-benchmark :<br><br> $ time ./python bench.py<br><br>where bech.py is:<br><br> f = dict((line, nr) for nr, line<br> in enumerate(open('/usr/share/dict/words',
<br> encoding='latin1').readlines()))<br><br>Python3k original hash: real 0m2.210s<br> new hash: real 0m1.842s<br><br>So maybe this is an interesting hash function?
<br><br>Tom</blockquote><div><br>Sounds like a great idea to me. Can you submit it as a patch?<br><br>We should run some more realistic perf tests and profiles but I imagine the impact will only be good.<br><br>-gps<br></div>
</div>