![]() ![]() If you are a beginner to Java, the intricacies of JVMs will be a lot to wrap your head around. ![]() The resource intensiveness of compilation can be a bigger hit (especially for client-side applications) but it also enables more advanced optimizations. Some JVMs skip interpretation and rely on compilation alone. Some JVMs interpret application code on load and use performance counters to focus on "hot" code. JVM varieties and Java platform independenceĪll JVM implementations have one thing in common, which is their attempt to get application bytecode translated into machine instructions. Unless you make changes to your original source and recompile the code (using the compiler), the output will always result in the same outcome this is because the input is a static input and the compiler is a static compiler. With static compilers the input code is interpreted once and the output executable is in the form that will be used when the program is executed. In the following sections I'll explain a bit more.Īn example of a static compiler is the previously mentioned javac. I briefly discussed static and dynamic compilers in Part 1 of this series. From there, we have options depending on what execution environment we're targeting, what performance results we desire, and what resource restrictions we need to meet. The highest level of separation is between static and dynamic compilers. If you want to learn more about bytecode and the JVM, see " Bytecode basics" (Bill Venners, JavaWorld).įrom a platform-agnostic perspective we want to keep code platform-independent as far as possible, so that the last translation level - from the lowest representation to actual machine code - is the step that locks the execution to a specific platform's processor architecture. (See " JVM performance optimization, Part 1" for a JVM overview and introduction to the series.) I'll also discuss some common optimizations used by Just-In-Time (JIT) compilers for Java. ![]() This second article in the JVM performance optimization series highlights and explains the differences between various Java virtual machine compilers. The more that you understand about compilers, in terms of how they work and what kinds are available, the more you'll be able to optimize Java application performance. Different kinds of compilers meet various application needs, thus yielding specific desired performance results. A software developer writes the best Java application that he or she can, and then the compiler works behind the scenes to produce efficient and well-performing execution code for the intended target platform. She concludes with an overview of common JVM optimizations such as dead-code elimination, inlining, and loop optimization.Ī Java compiler is the source of Java's famous platform independence. Eva Andreasson introduces the different breeds of compiler and compares performance results from client, server, and tiered compilation. Java compilers take center stage in this second article in the JVM performance optimization series. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |