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

Consider unrolling selected hashCode loops

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      Richard Startin points out that C2 (still) can't vectorize simple hashCode loops:

        https://richardstartin.com/2017/07/23/still-true-in-java-9-handwritten-hash-codes-are-faster/

      We should investigate whether it's worth unrolling selected hashCode methods in, e.g., java.lang.String and java.util.Arrays, by hand.

        Issue Links

          Activity

          Hide
          shade Aleksey Shipilev added a comment -
          JDK-8059113: Or maybe it is time to consider optimizing polynomial hash code (loops)?
          Show
          shade Aleksey Shipilev added a comment - JDK-8059113 : Or maybe it is time to consider optimizing polynomial hash code (loops)?
          Hide
          rriggs Roger Riggs added a comment -
          Hashcodes for Strings are cached by the vm so it would show a smaller overall benefit.
          Show
          rriggs Roger Riggs added a comment - Hashcodes for Strings are cached by the vm so it would show a smaller overall benefit.
          Hide
          kvn Vladimir Kozlov added a comment -
          Vectorization is very hard/imposible with data dependency in loop.
          But we need to find why auto-unroll done by C2 loopopts is worse than hand unrolling. And fix that if possible.
          Show
          kvn Vladimir Kozlov added a comment - Vectorization is very hard/imposible with data dependency in loop. But we need to find why auto-unroll done by C2 loopopts is worse than hand unrolling. And fix that if possible.
          Hide
          kvn Vladimir Kozlov added a comment -
          Should I close this as duplicate of JDK-8059113? That RFE precisely catches the issue.
          Show
          kvn Vladimir Kozlov added a comment - Should I close this as duplicate of JDK-8059113 ? That RFE precisely catches the issue.
          Hide
          rriggs Roger Riggs added a comment -
          Yes, it looks like a dup and may have come from the same blog source. Tnx
          Show
          rriggs Roger Riggs added a comment - Yes, it looks like a dup and may have come from the same blog source. Tnx
          Hide
          kvn Vladimir Kozlov added a comment -
          Closing as duplicate.
          I will add comment with Startin's page link to JDK-8059113.
          Show
          kvn Vladimir Kozlov added a comment - Closing as duplicate. I will add comment with Startin's page link to JDK-8059113 .

            People

            • Assignee:
              Unassigned
              Reporter:
              mr Mark Reinhold
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: