This is an automated email from the ASF dual-hosted git repository. rec pushed a commit to branch feature/UIMA-5823-Add-basic-benchmarking-module-v3 in repository https://gitbox.apache.org/repos/asf/uima-uimafit.git
commit 39a3bd3159cb5915afef9fe1d6043d84e7e18157 Author: Richard Eckart de Castilho <[email protected]> AuthorDate: Sun Jul 15 19:11:16 2018 +0200 [UIMA-5823] Add basic benchmarking module - Added a benchmark for select/indexCovering --- .../uima/fit/benchmark/JCasUtilBenchmark.java | 27 ++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/uimafit-benchmark/src/test/java/org/apache/uima/fit/benchmark/JCasUtilBenchmark.java b/uimafit-benchmark/src/test/java/org/apache/uima/fit/benchmark/JCasUtilBenchmark.java index e363d26..49b907c 100644 --- a/uimafit-benchmark/src/test/java/org/apache/uima/fit/benchmark/JCasUtilBenchmark.java +++ b/uimafit-benchmark/src/test/java/org/apache/uima/fit/benchmark/JCasUtilBenchmark.java @@ -20,9 +20,11 @@ package org.apache.uima.fit.benchmark; import static org.apache.uima.fit.benchmark.CasInitializationUtils.initRandomCas; import static org.apache.uima.fit.util.JCasUtil.indexCovered; +import static org.apache.uima.fit.util.JCasUtil.indexCovering; import static org.apache.uima.fit.util.JCasUtil.select; import static org.apache.uima.fit.util.JCasUtil.selectAll; import static org.apache.uima.fit.util.JCasUtil.selectCovered; +import static org.apache.uima.fit.util.JCasUtil.selectCovering; import org.apache.uima.fit.factory.JCasFactory; import org.apache.uima.fit.type.Sentence; @@ -105,10 +107,10 @@ public class JCasUtilBenchmark { @Test public void benchmarkSelectCovered() { Benchmark template = new Benchmark("TEMPLATE") - .initialize(n -> initRandomCas(jcas.getCas(), n)) - .magnitude(10) - .magnitudeIncrement(count -> count * 10) - .incrementTimes(4); + .initialize(n -> initRandomCas(jcas.getCas(), n)) + .magnitude(10) + .magnitudeIncrement(count -> count * 10) + .incrementTimes(4); new Benchmark("JCas selectCovered", template) .measure(() -> select(jcas, Sentence.class).forEach(s -> selectCovered(Token.class, s))) @@ -124,4 +126,21 @@ public class JCasUtilBenchmark { .measure(() -> indexCovered(jcas, Sentence.class, Token.class)) .run(); } + + @Test + public void benchmarkSelectCovering() { + Benchmark template = new Benchmark("TEMPLATE") + .initialize(n -> initRandomCas(jcas.getCas(), n)) + .magnitude(10) + .magnitudeIncrement(count -> count * 10) + .incrementTimes(3); + + new Benchmark("JCas selectCovering", template) + .measure(() -> select(jcas, Token.class).forEach(s -> selectCovering(Sentence.class, s))) + .run(); + + new Benchmark("JCas indexCovering", template) + .measure(() -> indexCovering(jcas, Token.class, Sentence.class)) + .run(); + } }
