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

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Duplicate
    • Priority: P4
    • 10
    • Affects Version/s: 9
    • Component/s: 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.

            Assignee:
            Jiangli Zhou
            Reporter:
            Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: