DateAndTime hash was: Re: [squeak-dev] true hash
Levente Uzonyi
leves at elte.hu
Mon May 14 03:04:04 UTC 2012
On Sat, 12 May 2012, Andres Valloud wrote:
> When asserting speedups and collision rates, please also mention what was the
> dataset used for the measurements. In that way, others can replicate the
> results and compare hash functions on a consistent basis.
+1. I started hacking it a bit and got another ~2x speedup on my
benchmark, but it was too simple and I didn't have the time to dig deeper.
Levente
>
> On 5/10/12 6:21 , Paul DeBruicker 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 )
>>
>>
>
>
More information about the Squeak-dev
mailing list
|