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

Feature structure removal from sorted index is very slow

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.3.1SDK
    • 2.4.1SDK
    • Core Java Framework
    • None

    Description

      Removal of feature structures from sorted indexes (e.g. default index) is very slow. FSIntArrayIndex.remove() method performs two operations: linear search in the array until the given FS is found, followed by the shift of elements to the end of this array by one position to the left.

      If many annotations (millions and more) are being deleted at once, this operation gets very very slow - much slower than adding these annotations in the first place. It seems to require O(N^2) time to remove N annotations.

      One item is the linear search, which can be replaced by the binary search method, which is already implemented in the same class.

      Second, array copy can be done with Java built-in method instead of a custom loop.

      Ideally, a method for bulk removal of a collection of annotations would have been the most efficient, for example a method to remove all annotations of a given type.

      Attachments

        Issue Links

          Activity

            People

              schor Marshall Schor
              mics Mikhail Sogrin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: