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

C2: Redundant address computations for array accesses

XMLWordPrintable

      public static void multArray(float[] a, float[] b, float[] m, int len) {
          for(int i = 0; i < len; i++) {
              m[i*3 ] = a[i*3]*b[i*3];
              m[i*3+1] = a[i*3+1]*b[i*3+1];
              m[i*3+2] = a[i*3+2]*b[i*3+2];
          }
      }

      # VM version: JDK 1.8.0_212, OpenJDK 64-Bit Server VM, 25.212-b04
      Benchmark Mode Cnt Score Error Units
      TestArrayPerf.testArray thrpt 20 80.675 ± 0.299 ops/s

      # VM version: JDK 14-internal, Java HotSpot(TM) 64-Bit Server VM, 14-internal+0-2019-06-13-0958212.vlivanov.null
      Benchmark Mode Cnt Score Error Units
      TestArrayPerf.testArray thrpt 20 63.299 ± 0.126 ops/s

        1. benchmarks.jar
          2.24 MB
        2. ideal_jdk14.png
          ideal_jdk14.png
          43 kB
        3. ideal_jdk8.png
          ideal_jdk8.png
          37 kB

            vlivanov Vladimir Ivanov
            vlivanov Vladimir Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: