About JIT knowledge of Java

Source: Internet
Author: User
1.JIT Working principle diagram

Working principle
When JIT compilation is enabled (enabled by default), the JVM reads the. class file after it is interpreted and sends it to the JIT compiler. The JIT compiler compiles the bytecode into the machine code of the cost machine.

Usually javac the program source code compiled, converted to Java bytecode, the JVM through the interpretation of bytecode to translate it into the corresponding machine instructions, read into each, explain the translation. It is clear that, after interpretation, it will run at a slower pace than the binary bytecode program that can be run. In order to improve the speed of operation, JIT technology is introduced.

JIT will save the translated machine code at the time of execution and is ready for the next use, so in theory, the JIT technology can be used to get close to the once pure compilation technology.

2. Related Knowledge
JIT is just in time, instant compilation technology. Using this technique, you can speed up the operation of your Java program.

The JIT doesn't always work, and you can't expect the JIT to speed up your code, and worse, it might reduce the speed of your code. It depends on the structure of your code and, of course, in very many cases we can still get it.

From above we know the reason to close JITjava.lang.Compiler.disable (); is due to speed of operation. Because the JIT compiles each byte code, it causes the compilation process to be overloaded. To avoid this situation, the current JIT compiles only the often-running bytecode, such as loops, etc.

About JIT knowledge of Java

Related Article

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.