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

StringTable::lookup_shared should not compute hash code if shared table is empty

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • 10
    • 9
    • hotspot

      This is a performance bug.

      oop StringTable::lookup_shared(jchar* name, int len) {
        return _shared_table.lookup((const char*)name,
                                    java_lang_String::hash_code(name, len), len);
      }

      There's no point of calculating the hash code if _shared_table is empty.

            jiangli Jiangli Zhou
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: