RFR: 8342540: InterfaceCalls micro-benchmark gives misleading results

Andrew Haley aph at openjdk.org
Fri Oct 18 11:59:06 UTC 2024


`InterfaceCalls.java` makes highly predictable memory accesses, which leads to a gross time underestimate of the case where a megamorphic access is unpredictable.

Here's one example, with and without randomization. The unpredictable megamorphic call takes more than 4* as long as the benchmark.


Benchmark (randomized) Mode Cnt Score Error Units
InterfaceCalls.test2ndInt3Types false avgt 4 5.034 ± 0.219 ns/op
InterfaceCalls.test2ndInt3Types true avgt 4 23.407 ± 0.475 ns/op
``` 

This patch adds the "scrambled" parameter, which allows the measurement of predictable and unpredictable megamorphic calls.

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

Commit messages:
 - 8342540: InterfaceCalls micro-benchmark gives misleading results

Changes: https://git.openjdk.org/jdk/pull/21581/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21581&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8342540
  Stats: 33 lines in 1 file changed: 21 ins; 6 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/21581.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/21581/head:pull/21581

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


More information about the hotspot-compiler-dev mailing list