JDK-8057169 : Improve CompilerOracle matchers search
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9,10
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2014-09-03
  • Updated: 2022-03-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Blocks :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
We use CompilerOracle through the CompileCommand in JMH. We use it a lot: every benchmark comes with a few compiler commands which forces/breaks inlining in key points. When we have lots of benchmarks in the single suite, all those compiler commands add up. Then, when Hotspot compiles the workload methods, it consults with CompilerOracle. CompilerOracle now uses the linear search to match the compile commands against the method names, and that search may take up to 10-20% of total compilation time when you we are dealing with thousands of compile commands. The overhead, obviously, grows linearly with the number of compile commands, and, by extension, the number of benchmarks in the suite (even if we don't run them at all!).

This affects the compile-time-sensitive benchmarks in the performance runs, and we can only partially mitigate that on JMH side (CODETOOLS-7901024), but after that our hands are tight, and the rest can only be fixed on VM side. At very least, search for the exact matches in a hash table, not linearly.
Comments
Sample benchmark: http://cr.openjdk.java.net/~shade/8057169/CompilerOracle.zip The benchmark uses WhiteBox API to recompile the methods over and over again. In more realistic cases, there are tons of distinct methods. The benchmark still represents the linear search case when we have no hits in CompilerOracle. Profile for this benchmark running on dev laptop shows 45% total time for CompilerOracle::*: http://cr.openjdk.java.net/~shade/8057169/profile.txt 51% is total time for compilation itself, so CompilerOracle consumes most of the cycles. The impact can be made arbitrarily high if more records are added to Hints file.
03-09-2014