uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Fäßler <erik.faess...@uni-jena.de>
Subject Performance of UIMAfit JCasUtil.selectCovered() and variants
Date Wed, 21 Oct 2015 15:07:17 GMT
Hi all,

I’m wondering about the performance differences between

1) JCasUtil.selectCovered(JCas, Class<T>, AnnotationFS),
2) JCasUtil.selectCovered(JCas, Class<T>, int, int) and
3) JCasUtil.indexCovered(JCas, Class<T>, Class<S>)

It is clear that 3) iterates once through the CAS and just returns a map. Once this is done,
map access is swift.

The Javadoc of 2) states that it is slower than 1).
3) states that it is preferable to 2).

Questions:
Is 3) also preferable over 2) when there is only one covering annotation or is the performance
of 2) and 3) roughly equal then?
Main question: Is 3) also quicker than 1) if there are many covering annotations?

Use case: I want to iterate through all sentences in paragraphs. Normally, I would use subiterators(),
but the known type priority issue could be a problem for me. Should I just use 1)? Or would
I still benefit from 3) if I have more than one paragraph?

Thank you very much!

Best,

Erik
Mime
View raw message