RFR: 8342826: Improve performance of oopDesc::klass() after JDK-8305895 [v7]

Roman Kennke rkennke at openjdk.org
Fri Nov 15 17:21:35 UTC 2024


> Before intergration of JEP 450, a number of minor regressions have been identified. The root-cause of those is the additional flag-check for UseCompactObjectHeaders in a couple of hot code-paths. This change addresses those cases by introducing a new helper class ObjLayout, which initializes some global state depending on the flags, and use that state later, instead of loading and checking multiple flags in hot paths.
> 
> This solution is not great. The real fix will eventually be to get rid of UseCompressedClassPointers in a first step, and later also get rid of UseCompactObjectHeaders, and settle on a single object layout. But we are not there, yet, and it will take several (or many) releases to get there. In the meantime, the proposed change eliminates the remaining known regressions.
> 
> Relevant benchmarks:
> 
> DaCapo:pmd (less is better)
> pre-jep450:  703.67ms
> mainline:  729.38ms
> alwaysinline: 730.45ms
> jdk8342826:  704.25ms
> 
> CryptoRsa (more is better)
> pre-jep450: 9315.719 ops/min
> mainline: 10109.509 ops/min
> alwaysinline: 10232.120
> jdk8342826: 10272.161 ops/min
> jdk8342826+alwaysinline: 10072.193 ops/min
> 
> Throw.throwWith64Frames microbenchmark
> Before JEP 450 (605396280d5ea225828da4ed688068334a15e122)
> Throw.throwWith64Frames  avgt   40  3943.690 ± 15.456  ns/op
> Mainline
> Throw.throwWith64Frames  avgt   40  4083.029 ± 12.044  ns/op
> JDK-8342826
> Throw.throwWith64Frames  avgt   40  3973.082 ± 12.956  ns/op

Roman Kennke has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 10 additional commits since the last revision:

 - Merge branch 'master' into JDK-8342826
 - Improve comment
 - Revert "Reorder 'Compact' vs 'Compressed'"
   
   This reverts commit 94275040e36982a36f9463e98189c0184fd5bbc8.
 - Reorder 'Compact' vs 'Compressed'
 - Move impl of has_klass_gap() into oop.hpp
 - Inline has_klass_gap()
 - Handle has_klass_gap
 - Rename KlassMode -> ObjLayout
 - Add missing includes
 - 8342826: Improve performance of oopDesc::klass() after JDK-8305895

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/22020/files
  - new: https://git.openjdk.org/jdk/pull/22020/files/e877d0bf..e80960a2

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=22020&range=06
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=22020&range=05-06

  Stats: 103530 lines in 2907 files changed: 20627 ins; 73660 del; 9243 mod
  Patch: https://git.openjdk.org/jdk/pull/22020.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22020/head:pull/22020

PR: https://git.openjdk.org/jdk/pull/22020


More information about the hotspot-runtime-dev mailing list