[project @ 2005-08-12 12:36:59 by simonmar]
authorsimonmar <unknown>
Fri, 12 Aug 2005 12:36:59 +0000 (12:36 +0000)
committersimonmar <unknown>
Fri, 12 Aug 2005 12:36:59 +0000 (12:36 +0000)
commit0066307ce8dc0501ee76bfcd45acbd6463e8f823
treecc504cfc928f0e4bc75cb0c810852420a8f6167e
parent3f1234649fee9d121801b44789e5b4fb91b647c3
[project @ 2005-08-12 12:36:59 by simonmar]
Use a better string hash: the previous one only took into account 3
characters from the string (0, N/2, N), leading to some bad collisions
with lots of similar strings (eg. local names generated by the
compiler).  Worse, it had a bug in the N==2 case, which meant that it
ignored one of the characters in the string completely.

We now traverse the whole string, using the algorithm from Data.Hash
which seems to work reasonably well.

For good measure, I quadrupled the size of the hash table too, from
1000 to 4000 entries.
ghc/compiler/utils/FastString.lhs