3

Recently i upgraded the JRE in my linux machine from 1.7 +JIT to 1.8 without JIT and noticed a huge degredation in performence, does Just In Time compilation JVM much faster then JVM with interpreter? Thanks,

drKnows
  • 53
  • 6
  • 2
    What? Which implementation of Java 8 doesn't have a JIT? But the answer *would be* yes. JIT compiled code will be orders of magnitude faster than interpreted code ... once the JVM has warmed up. – Stephen C Aug 03 '18 at 11:39
  • 1
    I appreciate the quick comeback! – GhostCat Aug 03 '18 at 19:30

1 Answers1

2

The whole intent of the JIT is to speed up code execution.

The major thing to remember: the JIT adds a "warm up" phase. The JVM has to spent to analyse what your code is doing, to then decide which parts to compile to machine code. And of course, that compilation step also requires a lot of time. But as soon as a method is compiled into machine code, of course it will be orders of magnitude faster.

But please note: I noticed a huge degradation in performance is an almost pointless statement. Performance only makes sense given context. Meaning: the context of workload (what are you running) and actual, real numbers.

GhostCat
  • 137,827
  • 25
  • 176
  • 248