Btw...

> On 2. Nov 2020, at 22:16, Mario Juric <mario.ju...@cactusglobal.com> wrote:
> 
> jCas.select(annotationType).coveredBy(annotation)

I did some local speed measurements and in particular for the "coveredBy" 
selector,
SelectFS is presently a good deal slower than the uimaFIT equivalent. I didn't 
look 
into speeding up SelectFS.coveredBy yet, but for the moment, you just might 
want to
stick with the uimaFIT version of selectCovered.

There is a "benchmark" module in the uimaFIT source repo which contains a few 
tentative
performance measurements.

==================
JCas selectCovered (using uimaFIT JCasUtil.select and selectCovered)
==================

    new Benchmark("JCas selectCovered", template)
      .measure(() -> select(jcas, Sentence.class).forEach(s -> 
selectCovered(Token.class, s)))
      .run();

Running benchmark... 10 100 1000 10000 

[     10/     20: min:    0 max:    2 median:    0 fail:    0 ]
[    100/     20: min:    0 max:    1 median:    0 fail:    0 ]
[   1000/     20: min:    4 max:   25 median:    5 fail:    0 ]
[  10000/     20: min:  170 max:  696 median:  193 fail:    0 ]

The 10, 100, 1000, etc are the numbers of annotations in the CAS (randomly 
generated Tokens/Sentences).
The 20 indicates how often the given lambda was measured.


=====================
JCas select.coveredBy v3 (using SelectFS select and coveredBy)
=====================

    new Benchmark("JCas select.coveredBy v3", template)
      .measure(() -> {
          jcas.select(Sentence.class).forEach(s -> 
jcas.select(Token.class).coveredBy(s).forEach(t -> {}));
      })
    .run();

Running benchmark... 10 100 1000 10000 

[     10/     20: min:    0 max:    4 median:    0 fail:    0 ]
[    100/     20: min:    1 max:   45 median:    2 fail:    0 ]
[   1000/     20: min:   15 max:   87 median:   24 fail:    0 ]
[  10000/     20: min:  862 max: 2919 median: 1310 fail:    0 ]


These numbers are from my local branches. The code in the master branches might 
behave slightly differently.

Cheers,

-- Richard

Reply via email to