My understanding is that in the Sun JVM, bytecode is still interpreted
before it gets hotspotted. Unlike the IBM JVM, for instance, where it's
always compiled (although with a quick, poor compiler at first, there
being a hotspot-like compiler to redo important bits later). I could be
out of date on this, but if i'm not, then we're all using interpreted code
every day.
Yes, initialisation code that gets run only once would not be
hotspotted. It would be run in interpreted form (more compact but
slower) Over time the hotspot engine gradually refines the
optimisation based on usage. However, the entire process is referred
to as hotspotting -- a combination of interpreted, native code, and
highly optimised native code.
It is absolutely mind boggling the way it can change code on the fly
right in the middle of execution. For example, when you load a new
class, what before was effectively final stops being so.
Benchmarks tend to run the same code over and over. They would soon
get optimised, so long as your benchmark ran long enough.
Hotspot has the advantage of run-time knowledge of what branches in
the code are most commonly executed. Native compilation has the
advantage of being able to take as long as it wants with the
optimisation.
--
Roedy Green Canadian Mind Products
http://mindprod.com
PM Steven Harper is fixated on the costs of implementing Kyoto, estimated as high as 1% of GDP.
However, he refuses to consider the costs of not implementing Kyoto which the
famous economist Nicholas Stern estimated at 5 to 20% of GDP