vcall wish for hotspot
Clemens Eisserer
linuxhippy at gmail.com
Sat May 18 16:22:47 PDT 2013
Hi Andy,
>> I do know that C++ compilers can emit much much faster vcalls,
>> especially when the class is not involving multiple inheritance.
> As to how much faster c++ is, I haven't coded in C++ at all in 5 years, and
> then it was on a much slower laptop, so I'm not set up to benchmark it.
You have not benchmarked it, yet claim to "know" C++ compilers emot
"much much" faster code for this case?
> Then in two identical warmed up loop functions of 10 billion iterations,
> one the iterates and returns the sum of Link get() and one that returns the sum of Link3 get(),
> compare the time to execute both.
> The difference is about .5 nanos per iteration on my machine.
The difference you see with your benchmark is not only the pure
overhead of bimorphic call logic, but far more important, branch
misprediction caused by the alternating branch targets.
- Clemens
More information about the hotspot-dev
mailing list