Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.3.1SDK
-
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
- relates to
-
UIMA-3413 improve remove-from-index performance
- Resolved