vcall wish for hotspot

Andrew Haley aph at redhat.com
Sat May 18 07:59:26 PDT 2013


On 05/17/2013 04:40 PM, Andy Nuss wrote:

> I profiled virtual calls on a very fast machine (core i7) after
> Aleksey pointing out some micro benchmark deficiencies in my
> benchmarking technique.  Corrected those.

Is this benchmark available somewhere?

> Nailed down the time of a virtual call on core i7: with or without
> interfaces involved, if a bimorphic call is enforced on hotspot due
> to inability to inline, the overhead is very close to 0.5 nanos,
> whether the method is in the base class or in an interface.
> 
> Knowing nothing about java's evolving design for interfaces and
> generics, I do know that C++ compilers can emit much much faster
> vcalls, especially when the class is not involving multiple
> inheritance.

How much faster?

> My wish:
> 
> That if Java knows that a class does not have interfaces, then
> theoretically, the bimorphic call thru the vtable of such a class
> should approach C++ speeds.
> 
> Is this wish ever achievable?

I think so.  But does it matter whether a class has interfaces?  Many
of them do, even if it's just something like Cloneable.

Andrew.


More information about the hotspot-compiler-dev mailing list