Java 7 中的分层编译是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16811140/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What's Tiered Compilation in Java 7?
提问by Aryan Venkat
Please help me knowing tiered compilation in deeper, which was a new feature in Java SE 7.
请帮助我更深入地了解分层编译,这是 Java SE 7 中的一个新特性。
Thanks in advance.
提前致谢。
回答by Scorpion
Read here
在这里阅读
Tiered Compilation
Tiered compilation, introduced in Java SE 7, brings client startup speeds to the server VM. Normally, a server VM uses the interpreter to collect profiling information about methods that is fed into the compiler. In the tiered scheme, in addition to the interpreter, the client compiler is used to generate compiled versions of methods that collect profiling information about themselves. Since the compiled code is substantially faster than the interpreter, the program executes with greater performance during the profiling phase. In many cases, a startup that is even faster than with the client VM can be achieved because the final code produced by the server compiler may be already available during the early stages of application initialization. The tiered scheme can also achieve better peak performance than a regular server VM because the faster profiling phase allows a longer period of profiling, which may yield better optimization.
分层编译
Java SE 7 中引入的分层编译为服务器 VM 带来了客户端启动速度。通常,服务器 VM 使用解释器来收集有关提供给编译器的方法的分析信息。在分层方案中,除了解释器之外,客户端编译器还用于生成方法的编译版本,这些方法收集有关自身的分析信息。由于编译后的代码比解释器快得多,程序在分析阶段以更高的性能执行。在许多情况下,可以实现比客户端 VM 更快的启动,因为服务器编译器生成的最终代码可能在应用程序初始化的早期阶段就已经可用。