A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2004-April/044241.html below:

[Python-Dev] String hash function multiplier

[Python-Dev] String hash function multiplier [Python-Dev] String hash function multiplierGuido van Rossum guido at python.org
Tue Apr 13 23:25:03 EDT 2004
> Does anyone have any issues with changing the hash multiplier for the
> string and Unicode hash functions?
> 
> Instead of 1000003, I would like to use Aho's 65599, a prime near 2**16
> that is efficiently expressible as (x << 6) + (x << 16) - x.   This
> replaces a multiply with fast adds and shifts (with the two shifts
> potentially being executed in parallel).  
> 
> Googling for "hash 65599" shows a long history of widespread use and
> testing without any problems.

It would break the parrot benchmark, which has a re-implementation of
the hash in Python and assumes/checks at various points that the two
agree.

So I'd rather not see this changed before July 30.

--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4