owlcs/owlapi — pull request #296 by sesuncedu (2014-09-29 05:25:44+00:00)
Title: Singletons for annotations and MapPointer value sets (first cut)

Could benefit from a bit more general approach (since the singleton set from java.util.Collections is a private class I have to assume that if a set isn't a trove hash set, it's that singleton).

Since there's wins available for using a few more types of set, there's probably a win from cloning a custom singleton set implementation.

examples: when quiescing a large set, the most compact form is an array.
If the set is only traversed, there is no need to do anything.

If the set is searched a few times, then sorting the array may be worth while, and using a binary search; It may be worth organizing the array into a heap.

If the set is added to, almost entirely with non duplicated elements , it may be worth guarding the set with a Bloom Filter, with a search performed only if the filter indicates the element may be present.

If the set is searched and modified heavily, it may be worth switching in the trove hash set.