Tuesday, January 5, 2010

Follow up to Product.hashCode collisions

After some experimentation here is the result that I came up. Note that you might need to increase the Heap Space to get it to run in the interpreter because of sort / removeDuplicates.

I posted it as a gist [http://gist.github.com/270117]

You should be able to just copy and paste it into a scala 2.8 interpreter
This yields a result of:

(ideal = 1000000.0, actual = 999880, uniqueRatio = 0.99988)
meaning a collision rate < .1%

1 comment:

Ben Jackman said...

Ok I changed it to just use the improve method from Hash Table in the scala standard library and here is what it does:
(ideal, unique, unique:ideal ratio)