performance surprise with Object.hashCode()

Aleksey Shipilev aleksey.shipilev at oracle.com
Mon May 13 10:01:29 PDT 2013


On 05/13/2013 07:44 PM, Andy Nuss wrote:
> * but when you force HotSpot to go thru the vtable for Integer.hashCode,
> the call grows to 4 nanos!
> 
> The last case was a big surprise, as I thought for Integer, a vcall to
> hashCode would only cost the 0.5 nanos of the vtable.

Ok, I would like to see the benchmark code, because 1/2 ns seems to be
barely enough to increment the counter for the microbenchmark you are
running, but have the v-call for the same time? Suspicious.

-Aleksey.


More information about the hotspot-compiler-dev mailing list