Java Virtual Machine Instant JIT compiler technology

Java virtual machine has many additional techniques to improve the speed, especially those related to the operation of loading, it referred to as "real time" (Just-In-Time, JIT) compiler technology. This technique can put all or part of the program translated to native machine code (which could have been the work of the JVM), running speed and therefore can be improved. When the need to load a class, the compiler will first find their .class files, then the class bytecode into memory. At this point, there are two options available:

(1) One is to make all the code compile-time compiler. However, this approach has two drawbacks: This loading operation scattered throughout the life cycle, it takes more time to accumulate; and increases the length of the executable code (bytecode than the local time compiler Expand many small machine code), which will result in paging, which reduces the speed of the program.

(2) Another approach is called lazy evaluation (lazy evaluation), mean time compiler only when necessary only compiled code, so the code will not be executed from perhaps they will not be compiled JIT. Java HotSpot technology on the new version of the JDK uses a similar method, the code will be executed every time to do some optimization, so the more the number of executions, and it's faster.

Guess you like

Origin blog.51cto.com/14512197/2444827