It is this flexibility that makes the JVM so powerful: it starts executing code fast, leverages optimizing compilers for frequently executed code, and speculates to apply even more aggressive optimizations.Īt first sight, this approach appears to be an ideal way to run an application. However, because code execution on the JVM is dynamic - if the assumptions it made become invalid at a later time - the JVM will deoptimize: it will disregard the compiled code and revert to interpreted mode. For example, the JVM can produce an optimized, compiled version of a method based on the profiling information it collects. Sometimes the compiler performs speculative optimizations. The top-tier compiler performs optimizations based on the profiling information about which code branches are executed most often, how frequently loops are executed, and which types are used in polymorphic code. Then, if it's still executed often enough and reaches certain thresholds, it is compiled by the top-tier JIT compiler (C2 or the Graal compiler). So, if your code "warms up" - gets frequently executed, it gets compiled to machine code by the C1 JIT compiler. That's why Oracle's JVM (HotSpot) also contains just-in-time (JIT) compilers, which compile your application code to machine code on the go, as your program executes. Despite the performance of the JVM interpreter, it's not as fast as running compiled code. When you first run your application, the VM interprets code and collects profiling information. One of the most powerful and interesting parts of the Java platform, enabling great peak performance, is the way the Java Virtual Machine (JVM) executes code. Traditional Execution of Java Applications It unlocks the runtime performance profile of native applications while keeping the familiar developer productivity and tooling of the Java ecosystem. One of the most discussed features of GraalVM is Native Image, which is based on an ahead-of-time (AOT) compilation. GraalVM has caused a revolution in Java development since it launched three years ago. Microsoft Azure supports your workload with abundant choices, whether you're working on a Java app, app server, or framework.
0 Comments
Leave a Reply. |