Micro-optimize Method.hashCode

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 24
    • Affects Version/s: 23
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved: