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

[lworld] Performance regression due to the fact that check if array is array of values is not hoisted out of the loop.

    Details

    • Type: Bug
    • Status: Open
    • Priority: P1
    • Resolution: Unresolved
    • Affects Version/s: repo-valhalla
    • Fix Version/s: repo-valhalla
    • Component/s: hotspot
    • Labels:

      Description

      Large performance regression is observed on numerous legacy (non-value) code working with Object[] arrays comparing -XX:+EnableValhalla vs -XX:-EnableValhalla

      For example:
      - Arrays.hasCode(Object[]) - 60% slowdown
      - for loop Object[] to Object[] copying - 2x times slowdown
      - pass elements of Object[] - 90% slowdown.
      - etc....

      Small set of simple benchmarks could be found here http://cr.openjdk.java.net/~skuksenko/valhalla/arrayloop/benchmarks/

      The reason of that that check if arrays is flattened value array was not hoisted out of the loop and checked on each iteration.

       asm for check (e.g.):
       mov 0x8(%r10),%r8d
       sar $0x1d,%r8d
       cmp $0xfffffffd,%r8d
       jne 0x00007f4d008cc2ad

        Attachments

          Activity

            People

            • Assignee:
              roland Roland Westrelin
              Reporter:
              skuksenko Sergey Kuksenko
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: