4 ms·
The Java Hotspot VM can still optimize for this case, if the virtual call leads to only a few classes most of the time. Several virtual methods can be inlined,
by andor 13y ago
The Java Hotspot VM can still optimize for this case, if the virtual call leads to only a few classes most of the time. Several virtual methods can be inlined, but of course there's still an extra step compared to static dispatch: the classes of the current object and the inlined methods have to be compared. If no matching method is inlined, control needs to be passed back to the VM.
- pmjordan 13y agoA fascinating article on this type of optimisation: http://www.azulsystems.com/blog/cliff/2010-04-08-inline-caches-and-call-site-optimization http://www.azulsystems.com/blog/cliff/2010-04-08-inline-cach...
- MrBuddyCasino 13y agoInteresting read, I didn't know that making fields final in Java does nothing for performance. Any idea what those "Generic Popular Frameworks" are? I put my money on Hibernate.