Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8342540

InterfaceCalls micro-benchmark gives misleading results

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • None
    • hotspot
    • b24
    • generic

      `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
      ```

            aph Andrew Haley
            aph Andrew Haley
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: