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

[lworld] arraycopy is not optimized for flattened array to flattened array copying

XMLWordPrintable

      System.arraycopy flattened to flattened copy - When the target array has static Q-type, it's from 3x times faster (100 elements) to 10% faster (1M elements) than when the target array has static L-type. At the same time, the manual copying loop shows the best performance in all cases (flattened to flattened).

      Benchmark (size) Mode Cnt Score Error Units
      InlineArrayCopy.Val_to_Val_as_Val_to_Ref_copy 100 avgt 5 57.123 ± 0.181 ns/op
      InlineArrayCopy.Val_to_Val_as_Val_to_Val_copy 100 avgt 5 15.934 ± 0.991 ns/op
      InlineCopy.Val_to_Val_as_Val_to_Ref_copy 100 avgt 5 18.206 ± 0.376 ns/op
      InlineCopy.Val_to_Val_as_Val_to_Val_copy 100 avgt 5 25.067 ± 0.915 ns/op

      Benchmarks: http://cr.openjdk.java.net/~skuksenko/valhalla/array_q_vs_l/benchmarks/

      Cmd line:
      ${JAVA_HOME}/bin/java -XX:+EnablePrimitiveClasses --enable-preview -jar target/benchmarks.jar Val_to_Val_as_Val_to_Val_copy Val_to_Val_as_Val_to_Ref_copy

            Unassigned Unassigned
            skuksenko Sergey Kuksenko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: