What is a JIT compiler

 

1. Introduction to JIT

JIT is the abbreviation of just in time, which is just in time compiler.

Using just-in-time compiler technology can accelerate the execution speed of Java programs.

 

Two, the problem

  1. Usually the program source code is compiled by javac and converted into java bytecode.
  2. JVM interprets bytecodes into corresponding machine instructions, reads in one by one, and interprets and translates one by one.

Obviously, after interpretation and execution, its execution speed will inevitably be much slower than executable binary bytecode programs.

 

Three, the solution

In order to improve the execution speed, JIT technology is introduced.

  1. At runtime, JIT will save the translated machine code for future use.

Therefore, in theory, using this JIT technology can approach the previous pure compilation technology.

 

Four, JIT compilation process

When JIT compilation is enabled (it is enabled by default), JVM reads the .class file for interpretation and sends it to the JIT compiler.

The JIT compiler compiles bytecode into native machine code.

Figure 1. JIT working principle diagram

 

 

https://developer.ibm.com/zh/articles/j-lo-just-in-time/

Guess you like

Origin blog.csdn.net/u013288190/article/details/112783466