On 03/17/2010 05:40 PM, Ian Bull wrote:
>From what I recall (this is a bit before my time),
when the query mechanism was first introduced, it was decided that all
query results (then called collectors) would collect things as Sets
(unique). Last year, I introduced the notion of List based collectors,
but this was never used and I don't think our current infrastructure
even supports it.
IMHO, this means we have gone back to what was originally
decided, all queries should return a set, and thus compound things
(like compound queryables) should return a unique set too.
Do others have thoughts on this?
The reason I'm concerned is that I want to avoid the rather serious
performance hit implied by such a contract. A query on a compound
queryable must then first bring everything into memory and then deliver
an iterator over the unique set to the actual query.
The alternative is to ask the IQueryResult for a set using the
toUnmodifiableSet() or toSet() method. If the query result already used
a set internally, that operation is free of charge. If not, well, then
it has just the matches to consider when building the unique set.
The only time that you would encounter duplicates is probably when you
query for all elements and then use the iterator directly.
- thomas
cheers,
_______________________________________________
p2-dev mailing list
p2-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/p2-dev
|