Why doesn't the JVM cache JIT compiled code?

前端 未结 5 1316
时光说笑
时光说笑 2020-11-28 19:30

The canonical JVM implementation from Sun applies some pretty sophisticated optimization to bytecode to obtain near-native execution speeds after the code has been run a few

5条回答
  •  天命终不由人
    2020-11-28 20:36

    Oracle's JVM is indeed documented to do so -- quoting Oracle,

    the compiler can take advantage of Oracle JVM's class resolution model to optionally persist compiled Java methods across database calls, sessions, or instances. Such persistence avoids the overhead of unnecessary recompilations across sessions or instances, when it is known that semantically the Java code has not changed.

    I don't know why all sophisticated VM implementations don't offer similar options.

提交回复
热议问题