Uploaded image for project: 'UIMA'
  1. UIMA
  2. UIMA-4206

IntHashSet table expansion should account for removed items better

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.7.0SDK
    • Component/s: Core Java Framework
    • Labels:
      None

      Description

      When items are removed from the IntHashSet, special "placeholders" take their place (and take up a slot in the table). When the table needs expanding due to the load factor, the copying into the new table will drop these placeholders, thus "reclaiming" the space. Resizing is triggered by the size + nbrRemoved exceeding the load factor. If the nbrRemoved is >= size, then keeping the same size table (instead of doubling it's size) will bring the load factor down to what it would have been in the absence of removes, when the table size was doubled. Change the reallocate to keep the size in this case (but still do the copying - which cleans up the removal placeholders).

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            schor Marshall Schor
            Reporter:
            schor Marshall Schor
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development