DateAndTime hash was: Re: [squeak-dev] true hash
Bert Freudenberg
bert at freudenbergs.de
Thu May 10 17:29:15 UTC 2012
On 10.05.2012, at 19:05, Eliot Miranda wrote:
>
>
> On Thu, May 10, 2012 at 6:21 AM, Paul DeBruicker <pdebruic at gmail.com> wrote:
> On 05/10/2012 04:21 AM, Nicolas Cellier wrote:
> Sure, I already changed various Number>>hash and could as well change
> Point hash to follow recommendations from Andres valloud book hashing
> in smalltalk...
>
> Nicolas
>
> DateAndTime>>#hash could be changed to :
>
> hash
> ^ (jdn hashMultiply bitXor: seconds + offset asSeconds) bitXor: nanos
>
> which is 130x faster than whats currently in the image:
>
> hash
> ^ self asUTC ticks hash
>
>
> The collision rate on the proposed hash function is 0.04% ( 4 per 10,000 )
>
> Just doit. Make that change. If you don't have commit rights, commit it to inbox. please!
But take care with rehashing existing sets/collections.
- Bert -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20120510/bbaba381/attachment-0001.htm
More information about the Squeak-dev
mailing list
|