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

IntHashSet table expansion should account for removed items better

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.7.0SDK
    • Core Java Framework
    • 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).

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment