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

Remove Hashtable::reverse()

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 10
    • Fix Version/s: 10
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b21

      Description

      Hashtable::reverse() was added JDK-4994483, because:

      "the String and symbol tables are hashtables where the hashbuckets
      are linked lists -- in reverse chronological order of there creation. This
      means that, in some circumstances, some symbols are unnecessarily touched
      when looking for older most likely needed symbols. This can be addressed by
      simply reversing the order of the lists before creating the archive."

      Since JDK9, CDS no longer stores the string and symbol tables using the "regular" hashtable. Instead, CompactHashtable is used.

      The only "regular" hashtable use by CDS is the shared dictionary (for name->class lookup), but this table is rehashed at some point during archive dumping (see Dictionary::reorder_dictionary). Therefore, calling reverse() will no longer has the desired effect of moving popular Klasses (such as java/lang/Object) to the front of a linked-list.

      So this optimization is irrelevant now.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              iklam Ioi Lam
              Reporter:
              iklam Ioi Lam
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: