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

(coll) Reduce HashSet bloat

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Unresolved
    • P4
    • None
    • 7
    • core-libs

    Description

      HashSet is implemented by delegating to an internal HashMap,
      which is suboptimal, especially from the point of view of "Bloat".
      As expressed well in

      The Causes of Bloat, the Limits of Health

      http://domino.research.ibm.com/comm/research_people.nsf/pages/sevitsky.pubs.html/$FILE/oopsla2007-bloat.pdf

      "The standard Java HashSet, which stores
      a set of unique values, is implemented by delegating to the
      more general HashMap, which in turn points to an array
      of HashMap$Entry objects that point to keys and values,
      and to each other.7 The delegation of HashSet to HashMap
      raises the fixed collection overhead for each of these nested
      HashMaps; the overgenerality of HashMap raises both the
      fixed and variable overhead costs: the HashMap has book-
      keeping fields that are not relevant to this use, and all of the
      inner HashMap$Entry objects point to the same (unused)
      singleton value."

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              martin Martin Buchholz
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Imported:
                Indexed: