[ENH] HashCollisionsCheck

Lex Spoon lex at cc.gatech.edu
Sat Aug 24 23:31:53 UTC 2002


This kind of tool is neat.  I get only four reported sets that have any
collisions, which is nice at first.

Two odd things came up.  First, this seems really low.  I believe the
issue is that it only counts when hashes *exactly* match, and not when
hashes are the same after a mod operation.   Tweaking your code with a
"\\ theRelevantCollection size" in the right place gives me 6300 sets
with collisions, which seems more realistic.

Second, I found a couple of Identity dictionaries whose #size is 4 but
which have only 3 keys.  Very strange!

For anyone interested, the bad sets in my system seem to be:

	1. Celeste's message collections hash badly.  This is disturbing since
they use a customized PluggableSet.  Maybe the customized function needs
to be reexamined!

	2. Lots of method dictionaries hash badly.


Overall, it is quite nice to have tools like this to help improve hash
functions.  Thanks for posting it, Stephen!  If I recall correctly, you
sent the last changeset of this nature around, too, several years ago.


-Lex



More information about the Squeak-dev mailing list