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

Reply via email to