RFR: 8372701: Randomized profile counters

Andrew Haley aph at openjdk.org
Thu Nov 27 17:11:18 UTC 2025


Please use [this link](https://github.com/openjdk/jdk/pull/28541/files?w=1) to view the files changed.

Profile counters scale very badly.

The overhead for profiled code isn't too bad with one thread, but as the thread count increases, things go wrong very quickly.

For example, here's a benchmark from the OpenJDK test suite, run at TieredLevel 3 with one thread, then three threads:


Benchmark (randomized) Mode Cnt Score Error Units
InterfaceCalls.test2ndInt5Types false avgt 4 27.468 ± 2.631 ns/op
InterfaceCalls.test2ndInt5Types false avgt 4 240.010 ± 6.329 ns/op


This slowdown is caused by high memory contention on the profile counters. Not only is this slow, but it can also lose profile counts.

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

Commit messages:
 - whitespace
 - AArch64
 - Minimize deltas to master
 - Better
 - Inter
 - Cleanup
 - Cleanup
 - D'oh
 - More
 - More
 - ... and 40 more: https://git.openjdk.org/jdk/compare/9a88d7f4...66ea5872

Changes: https://git.openjdk.org/jdk/pull/28541/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=28541&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8372701
  Stats: 1122 lines in 26 files changed: 892 ins; 39 del; 191 mod
  Patch: https://git.openjdk.org/jdk/pull/28541.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28541/head:pull/28541

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


More information about the hotspot-dev mailing list