JDK-8216302 : StackTraceElement::fill_in can use cached Class.name
  • Type: Sub-task
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11,12,13
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-01-07
  • Updated: 2019-09-06
  • Resolved: 2019-01-09
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.
JDK 11 JDK 12 JDK 13
11.0.3Fixed 12.0.2Fixed 13 b03Fixed
Description
This is the simple subtask from JDK-8151751. Class.name is already cached on Java side, so field is available for caching the name. We can use that field when creating the stack trace elements.

Candidate patch gives a very nice result:

Benchmark             (depth)  Mode  Cnt    Score    Error  Units

# 8u192
StackTraceBench.test        1  avgt   15   10.851 �� 0.075  us/op
StackTraceBench.test       10  avgt   15   15.325 �� 0.089  us/op
StackTraceBench.test      100  avgt   15   59.717 �� 0.449  us/op
StackTraceBench.test     1000  avgt   15  529.020 �� 3.654  us/op

# jdk/jdk, baseline
StackTraceBench.test        1  avgt   15    23.835 �� 0.188  us/op
StackTraceBench.test       10  avgt   15    33.204 �� 0.191  us/op
StackTraceBench.test      100  avgt   15   125.195 �� 0.694  us/op
StackTraceBench.test     1000  avgt   15  1051.047 �� 9.779  us/op

# jdk/jdk, patched
StackTraceBench.test        1  avgt   15   14.450 �� 0.136  us/op
StackTraceBench.test       10  avgt   15   20.182 �� 0.088  us/op
StackTraceBench.test      100  avgt   15   77.107 �� 0.632  us/op
StackTraceBench.test     1000  avgt   15  647.128 �� 6.159  us/op

Comments
Fix Request This patch fixes the significant performance regression introduced in 9, and affecting users on 11. The patch applies with minor conflicts (casts in deleted code, surrounding code in symbols.unix) to 11u, and without conflicts to 12u. It passes tier1 tests on Linux x86_64 in both 11u and 12u, including the new test. Additionally, I checked no references to JVM_GetClassName symbol are left.
11-02-2019