Java Instant Compile JIT

Source: Internet
Author: User

JIT in Java

Class is compiled into executable code (native script)

JIT Compiler (Just-in-time Compiler) Instant compilation
The earliest Java build scheme was a set of translation programs (interpreter) that translated each Java instruction into a peer microprocessor directive and executed sequentially according to the order in which it was translated, since a Java instruction could be translated into more than 10 or more than 10 equivalent microprocessor instructions, This pattern executes quite slowly. To address this problem, the industry first developed a JIT (just in time) compiler. When Java executes the runtime environment, each time a new category (Class: Class is a functional group in a Java program) is encountered, the category is a functional group in the Java program-jit compiler will compile (compile) jobs for this category at this time. The compiled program is optimized to be a fairly streamlined native script (native code), which executes fairly quickly. It takes a little time to compile to save a considerable amount of execution time later, and the JIT design does add a lot of efficiency, but it does not achieve the best performance, because some of the very few Java instructions that are executed at compile time may be more time-consuming than when the translator is executing, for these instructions, The overall time spent did not decrease. Based on the experience of JIT, the industry has developed dynamic compilers (compiler), which are compiled only for more frequently executed code, while the remainder is still executed using the translator. In other words, the dynamic compiler will determine whether to compile each category. The dynamic compiler has two tools: one is the translator and the other is JIT, which analyzes each category through the intelligence mechanism and then decides which of these two tools to use to achieve optimal results. The dynamic compiler's feature for a program is either to let the program execute several loops, and then decide whether to compile the code based on the results. This decision is not necessarily correct, but judging from the statistics, the right opportunity for the judging mechanism is quite high. In fact, dynamic compilers make decisions based on "historical data", so the longer the program executes, the higher the chance of judging the right. The result is that the code generated by the dynamic compiler executes faster than the previous JIT technique, and the average speed can be increased to 50%.

Java Instant Compile JIT

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.