Just-in-time compilation - when does it actually take place in Java?
Recently I took part in a discussion over the efficiency of Java. As I
listened, plenty of arguments against Java were that interpreting is
"extremely time consuming" and because of it even simple Java programs run
way slower than similar one's compiled directly to machine code.
An answer to that was that Java code is often compiled directly to machine
code, if only JVM calculates it makes program faster than if it was
interpreted in a standard way.
My questions are: when does JVM actually "decide" to perform just-in-time
compilation? What are the criteria that make JIT more efficient than
standard bytecode interpreting? I mean, the compilation takes some time
itself, and as far as I understand, it is all supposed to happen when the
program is already running?
No comments:
Post a Comment