什么是CompileThreshold、Tier2CompileThreshold、Tier3CompileThreshold和Tier4CompileThreshold控件?

时间:2021-04-25 17:21:56

HotSpot's tiered compilation uses the interpreter until a threshold of invocations (for methods) or iterations (for loops) triggers a client compilation with self-profiling. The client compilation is used until another threshold of invocations or iterations triggers a server compilation.

HotSpot的分层编译使用解释器,直到调用的阈值(用于方法)或迭代(for循环)触发客户端编译并进行自我剖析。直到调用或迭代的另一个阈值触发服务器编译时,才使用客户机编译。

Printing HotSpot's flags shows the following flag values with -XX:+TieredCompilation.

使用-XX:+ tieredcompile打印HotSpot的标志显示以下标志值。

intx CompileThreshold      = 10000 {pd product}        
intx Tier2CompileThreshold = 0     {product}           
intx Tier3CompileThreshold = 2000  {product}           
intx Tier4CompileThreshold = 15000 {product}           

There are too many flags for just a client and server compiler. What compilers are controlled by these flags? If not client and server, what is the purpose of the additional compilers?

对于一个客户机和服务器编译器来说,有太多的标志。哪些编译器由这些标志控制?如果不是客户端和服务器,那么其他编译器的目的是什么?

Are CompileThreshold and Tier2CompileThreshold ignored in this case? What does Tier3CompileThreshold control when a client compilation is triggered? What does Tier4CompileThreshold control when a server compilation is triggered?

在本例中是否忽略了CompileThreshold和Tier2CompileThreshold ?当触发客户端编译时,Tier3CompileThreshold控制什么?当服务器编译被触发时,Tier4CompileThreshold控件是什么?

1 个解决方案

#1


19  

The comments in advancedThresholdPolicy.hpp discuss the different compiler tiers and the thresholds. See that file for a deeper discussion.

advancedThresholdPolicy的评论。hpp讨论了不同的编译器层和阈值。请参阅该文件以获得更深入的讨论。

The system supports 5 execution levels:

系统支持5个执行级别:

  • Tier 0 - interpreter
  • 层0 -翻译
  • Tier 1 - C1 with full optimization (no profiling)
  • 第1层-带有完整优化的C1(无概要分析)
  • Tier 2 - C1 with invocation and backedge counters
  • 层2 -带有调用和备份计数器的C1
  • Tier 3 - C1 with full profiling (level 2 + MDO)
  • 第3层-带有完整剖析的C1(第2级+ MDO)
  • Tier 4 - C2
  • 层4 - C2

C1 is the client compiler. C2 is the server compiler.

C1是客户端编译器。C2是服务器编译器。

In the common case, the compilation goes: 0 → 3 → 4. Atypical cases are used based on C1 and C2 queue lengths. Tier 2 is used when the C2 queue length is too long so that the method can execute about 30% faster until the C2 can process the profiling information. If the method is determined to be trivial, then it is compiled with Tier 1 since it will produce the same code as Tier 4.

在普通情况下,编译是:0→3→4。根据C1和C2的队列长度使用非典型情况。当C2队列长度太长时,将使用第2层,以便该方法可以以大约30%的速度执行,直到C2能够处理分析信息为止。如果该方法被确定为平凡的,那么它将使用第1层编译,因为它将生成与第4层相同的代码。

Thresholds are dynamically adjusted based on the length of the C1 and C2 queues.

阈值是根据C1和C2队列的长度动态调整的。

#1


19  

The comments in advancedThresholdPolicy.hpp discuss the different compiler tiers and the thresholds. See that file for a deeper discussion.

advancedThresholdPolicy的评论。hpp讨论了不同的编译器层和阈值。请参阅该文件以获得更深入的讨论。

The system supports 5 execution levels:

系统支持5个执行级别:

  • Tier 0 - interpreter
  • 层0 -翻译
  • Tier 1 - C1 with full optimization (no profiling)
  • 第1层-带有完整优化的C1(无概要分析)
  • Tier 2 - C1 with invocation and backedge counters
  • 层2 -带有调用和备份计数器的C1
  • Tier 3 - C1 with full profiling (level 2 + MDO)
  • 第3层-带有完整剖析的C1(第2级+ MDO)
  • Tier 4 - C2
  • 层4 - C2

C1 is the client compiler. C2 is the server compiler.

C1是客户端编译器。C2是服务器编译器。

In the common case, the compilation goes: 0 → 3 → 4. Atypical cases are used based on C1 and C2 queue lengths. Tier 2 is used when the C2 queue length is too long so that the method can execute about 30% faster until the C2 can process the profiling information. If the method is determined to be trivial, then it is compiled with Tier 1 since it will produce the same code as Tier 4.

在普通情况下,编译是:0→3→4。根据C1和C2的队列长度使用非典型情况。当C2队列长度太长时,将使用第2层,以便该方法可以以大约30%的速度执行,直到C2能够处理分析信息为止。如果该方法被确定为平凡的,那么它将使用第1层编译,因为它将生成与第4层相同的代码。

Thresholds are dynamically adjusted based on the length of the C1 and C2 queues.

阈值是根据C1和C2队列的长度动态调整的。