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

Micro-optimize Method.hashCode

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • 23
    • core-libs

      We are seeing some evidence that `Method.hashCode` is hot in some enterprise stacks, notably Spring. Even though `Method.hashCode` is already quite small:

      ```
          public int hashCode() {
              return getDeclaringClass().getName().hashCode() ^ getName().hashCode();
          }
      ```

      ...caching its result might still be a win.

            shade Aleksey Shipilev
            shade Aleksey Shipilev
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: