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
in repository https://gitbox.apache.org/repos/asf/uima-uimafit.git
The following commit(s) were added to
refs/heads/feature/UIMA-5823-Add-basic-benchmarking-module by this push:
new c05b843 [UIMA-5823] Add basic benchmarking module
c05b843 is described below
commit c05b84301d9761da199ae030fc883cccec1bd276
Author: Richard Eckart de Castilho <[email protected]>
AuthorDate: Sun Jul 15 19:34:14 2018 +0200
[UIMA-5823] Add basic benchmarking module
- Iterate over results in covered/covering tests
---
.../uima/fit/benchmark/CasUtilBenchmark.java | 26 +++++++++++++++-------
.../uima/fit/benchmark/JCasUtilBenchmark.java | 6 ++---
2 files changed, 21 insertions(+), 11 deletions(-)
diff --git
a/uimafit-benchmark/src/test/java/org/apache/uima/fit/benchmark/CasUtilBenchmark.java
b/uimafit-benchmark/src/test/java/org/apache/uima/fit/benchmark/CasUtilBenchmark.java
index b2ad1b1..673491b 100644
---
a/uimafit-benchmark/src/test/java/org/apache/uima/fit/benchmark/CasUtilBenchmark.java
+++
b/uimafit-benchmark/src/test/java/org/apache/uima/fit/benchmark/CasUtilBenchmark.java
@@ -82,7 +82,7 @@ public class CasUtilBenchmark {
new Benchmark("CAS select TOP and iterate", template)
.measure(() -> selectFS(cas, getType(cas, CAS.TYPE_NAME_TOP)).forEach(v
-> {}))
.run();
-
+
new Benchmark("CAS select ALL", template)
.measure(() -> selectAll(cas))
.run();
@@ -102,14 +102,15 @@ public class CasUtilBenchmark {
new Benchmark("CAS selectCovered", template)
.measure(() -> {
- Type sentenceType = getType(cas, TYPE_NAME_SENTENCE);
- Type tokenType = getType(cas, TYPE_NAME_TOKEN);
- select(cas, sentenceType).forEach(s -> selectCovered(tokenType, s));
+ Type sentenceType = getType(cas, TYPE_NAME_SENTENCE);
+ Type tokenType = getType(cas, TYPE_NAME_TOKEN);
+ select(cas, sentenceType).forEach(s -> selectCovered(tokenType,
s).forEach(t -> {}));
})
.run();
new Benchmark("CAS indexCovered", template)
- .measure(() -> indexCovered(cas, getType(cas, TYPE_NAME_SENTENCE),
getType(cas, TYPE_NAME_TOKEN)))
+ .measure(() -> indexCovered(cas, getType(cas, TYPE_NAME_SENTENCE),
getType(cas, TYPE_NAME_TOKEN))
+ .forEach((s, l) -> l.forEach(t -> {})))
.run();
}
@@ -121,7 +122,15 @@ public class CasUtilBenchmark {
.magnitudeIncrement(count -> count * 10)
.incrementTimes(3);
- new Benchmark("JCas selectCovering", template)
+ new Benchmark("CAS selectCovering", template)
+ .measure(() -> {
+ Type sentenceType = getType(cas, TYPE_NAME_SENTENCE);
+ Type tokenType = getType(cas, TYPE_NAME_TOKEN);
+ select(cas, tokenType).forEach(t -> selectCovering(sentenceType, t));
+ })
+ .run();
+
+ new Benchmark("CAS selectCovering", template)
.measure(() -> {
Type sentenceType = getType(cas, TYPE_NAME_SENTENCE);
Type tokenType = getType(cas, TYPE_NAME_TOKEN);
@@ -129,8 +138,9 @@ public class CasUtilBenchmark {
})
.run();
- new Benchmark("JCas indexCovering", template)
- .measure(() -> indexCovering(cas, getType(cas, TYPE_NAME_TOKEN),
getType(cas, TYPE_NAME_SENTENCE)))
+ new Benchmark("CAS indexCovering", template)
+ .measure(() -> indexCovering(cas, getType(cas, TYPE_NAME_TOKEN),
getType(cas, TYPE_NAME_SENTENCE))
+ .forEach((t, l) -> l.forEach(s -> {})))
.run();
}
}
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 5749aa8..591dfb8 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
@@ -101,7 +101,7 @@ public class JCasUtilBenchmark {
.run();
new Benchmark("JCas indexCovered", template)
- .measure(() -> indexCovered(jcas, Sentence.class, Token.class))
+ .measure(() -> indexCovered(jcas, Sentence.class,
Token.class).forEach((s, l) -> l.forEach(t -> {})))
.run();
}
@@ -114,11 +114,11 @@ public class JCasUtilBenchmark {
.incrementTimes(3);
new Benchmark("JCas selectCovering", template)
- .measure(() -> select(jcas, Token.class).forEach(s ->
selectCovering(Sentence.class, s)))
+ .measure(() -> select(jcas, Token.class).forEach(t ->
selectCovering(Sentence.class, t)))
.run();
new Benchmark("JCas indexCovering", template)
- .measure(() -> indexCovering(jcas, Token.class, Sentence.class))
+ .measure(() -> indexCovering(jcas, Token.class,
Sentence.class).forEach((t, l) -> l.forEach(s -> {})))
.run();
}
}