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

Avoid recalculating String.hash when zero

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 13
    • 13
    • core-libs
    • b16

      As suggested in RFR thread for JDK-8221723 (http://mail.openjdk.java.net/pipermail/core-libs-dev/2019-April/059480.html) we can add a boolean/byte to String to mark that a String.hash has been calculated as zero with neither footprint nor notable performance penalties.

      On top of the patch suggested by Peter, we should make the VM code cooperate when necessary, but with the suggested approach VM code typically does not need to set the hashIsZero flag to be semantically consistent.

            redestad Claes Redestad
            redestad Claes Redestad
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: