vcall wish for hotspot
andrew_nuss at yahoo.com
Fri May 17 08:40:03 PDT 2013
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.
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.
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?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the hotspot-compiler-dev