Java JIT technology and Google's V8

Source: Internet
Author: User

 What is V8?

V8 is Google's open-source JavaScript Engine.

V8 is written in C ++ and can be used in Google's open-source browser.

V8 uses ecmascript based on instructions in the third edition of ECMA-262 and runs in Windows XP and Vista, Mac OS X 10.5 (Leopard), and Linux systems that use IA-32 or arm processors.

V8 can run independently or be embedded in any c ++ application.

Java JIT Technology JITCompilation process

WhenJITWhen compilation is enabled (enabled by default), the JVM reads the. Class File explanation and sends itJITCompiler.JITThe compiler will compile the machine code at the cost of bytecode to demonstrate this process.

What isJIT?

JITJust in time, real-time compilation technology. This technology can accelerateJavaProgram execution speed. Next, we will give a brief explanation of this technology.

First, we all know that javac usually compiles and converts the program source codeJavaThe JVM translates the bytecode into corresponding machine commands by interpreting the bytecode, reading them one by one, and interpreting the translation one by one. Obviously, after explanation, the execution speed will inevitably be slower than that of the executable binary bytecode program. To improve the execution speedJITTechnology.

At runtimeJITThe translated machine code is saved and used for the next time. Therefore, theoretically, thisJITThe technology is good. It can be close to the previous pure compilation technology. Let me see,JIT.

WhenJITWhen compilation is enabled (enabled by default), the JVM reads the. Class File explanation and sends itJITCompiler.JITThe compiler compiles bytecode into machine code.

Through the above explanation, we understandJITAlso found a problem dueJITEach byte code is compiled, causing excessive burden on the compilation process. To avoid this situation, the currentJITCompile only frequently executed bytecode, such as loops.

It must be noted that,JITNot always effective, not expectedJITIt will certainly speed up your code execution. What's worse, it may reduce the speed of code execution. It depends on your code structure. Of course, in many cases, we can still get what we want.

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.