harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Ellison <t.p.elli...@gmail.com>
Subject Re: [classlib] Some further study on hashcode and HashMap
Date Mon, 09 Jul 2007 12:23:26 GMT
Tim Ellison wrote:
> Jimmy,Jing Lv wrote:
>>     I'm not strongly against this commit, but just as I explained in
>> the first mail, to make the numBuckets a power of two (&(bucketsize -
>> 1)) is always good, but the simple right shift (>>2) may cause some
>> benchmark improved (properly in these benchmarks hashcode is directly
>> identityHashCode) while others are reduced (hashcode are
>> user-defined). A known reduced benchmark is specjbb.
>>    I don't know when will vm improve their hashcode implementation,
>> and different vms will re-act to this at different time, so I doubt
>> the best way for applying simply shift ( >>2 ) is waiting for vm to
>> improve themselves and do no change to classlib. However this is not a
>> very urgent issue :)
> Ok, how about we flip it around then.  I'll modify the code to compute
>     int bucket = hashCode & (numBuckets - 1);
> with the understanding that our current VMs are penalized until they
> enhance their identityHashCode implementations?
> Anyone object to doing it this way around?

FYI: there being no objections, I committed the code at repo revision


View raw message