You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by re...@apache.org on 2018/07/15 17:24:21 UTC

[uima-uimafit] branch feature/UIMA-5823-Add-basic-benchmarking-module-v3 updated (00d6cc8 -> 9e1cf4d)

This is an automated email from the ASF dual-hosted git repository.

rec pushed a change to branch feature/UIMA-5823-Add-basic-benchmarking-module-v3
in repository https://gitbox.apache.org/repos/asf/uima-uimafit.git.


    from 00d6cc8  [UIMA-5823] Add basic benchmarking module
     new 39a3bd3  [UIMA-5823] Add basic benchmarking module
     new f98cb36  [UIMA-5823] Add basic benchmarking module
     new 9e1cf4d  [UIMA-5823] Add basic benchmarking module

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../uima/fit/benchmark/CasUtilBenchmark.java       | 38 ++++++++++++++++++++--
 .../uima/fit/benchmark/JCasUtilBenchmark.java      | 35 +++++++++++++++++---
 2 files changed, 66 insertions(+), 7 deletions(-)


[uima-uimafit] 01/03: [UIMA-5823] Add basic benchmarking module

Posted by re...@apache.org.
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 <re...@apache.org>
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();
+  }
 }


[uima-uimafit] 02/03: [UIMA-5823] Add basic benchmarking module

Posted by re...@apache.org.
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 f98cb364d0bf2c9d44411a1c2dae287a9a75b01e
Author: Richard Eckart de Castilho <re...@apache.org>
AuthorDate: Sun Jul 15 19:13:22 2018 +0200

    [UIMA-5823] Add basic benchmarking module
    
    - Added a benchmark for select/indexCovering
---
 .../uima/fit/benchmark/CasUtilBenchmark.java       | 29 ++++++++++++++++++++--
 1 file changed, 27 insertions(+), 2 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 8254048..569b884 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
@@ -18,12 +18,16 @@
  */
 package org.apache.uima.fit.benchmark;
 
-import static org.apache.uima.fit.factory.TypeSystemDescriptionFactory.*;
 import static org.apache.uima.fit.benchmark.CasInitializationUtils.initRandomCas;
+import static org.apache.uima.fit.factory.TypeSystemDescriptionFactory.createTypeSystemDescription;
+import static org.apache.uima.fit.util.CasUtil.getType;
 import static org.apache.uima.fit.util.CasUtil.indexCovered;
+import static org.apache.uima.fit.util.CasUtil.indexCovering;
 import static org.apache.uima.fit.util.CasUtil.select;
 import static org.apache.uima.fit.util.CasUtil.selectAll;
-import static org.apache.uima.fit.util.CasUtil.*;
+import static org.apache.uima.fit.util.CasUtil.selectCovered;
+import static org.apache.uima.fit.util.CasUtil.selectCovering;
+import static org.apache.uima.fit.util.CasUtil.selectFS;
 
 import org.apache.uima.cas.CAS;
 import org.apache.uima.cas.Type;
@@ -134,4 +138,25 @@ public class CasUtilBenchmark {
           .forEach((s, l) -> l.forEach(t -> {})))
       .run();
   }
+  
+  @Test
+  public void benchmarkSelectCovering() {
+    Benchmark template = new Benchmark("TEMPLATE")
+      .initialize(n -> initRandomCas(cas, n))
+      .magnitude(10)
+      .magnitudeIncrement(count -> count * 10)
+      .incrementTimes(3);
+    
+    new Benchmark("JCas selectCovering", template)
+      .measure(() -> {
+        Type sentenceType = getType(cas, TYPE_NAME_SENTENCE);
+        Type tokenType = getType(cas, TYPE_NAME_TOKEN);
+        select(cas, tokenType).forEach(s -> selectCovering(sentenceType, s));
+      })
+      .run();
+
+    new Benchmark("JCas indexCovering", template)
+      .measure(() -> indexCovering(cas, getType(cas, TYPE_NAME_TOKEN), getType(cas, TYPE_NAME_SENTENCE)))
+      .run();
+  }
 }


[uima-uimafit] 03/03: [UIMA-5823] Add basic benchmarking module

Posted by re...@apache.org.
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 9e1cf4d0361885acb45dc5895f0dcfbd6e0b489d
Author: Richard Eckart de Castilho <re...@apache.org>
AuthorDate: Sun Jul 15 19:24:17 2018 +0200

    [UIMA-5823] Add basic benchmarking module
    
    - Added a benchmark for select/indexCovering
---
 .../org/apache/uima/fit/benchmark/CasUtilBenchmark.java | 17 +++++++++++++----
 .../apache/uima/fit/benchmark/JCasUtilBenchmark.java    | 12 +++++++++---
 2 files changed, 22 insertions(+), 7 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 569b884..414c364 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
@@ -147,16 +147,25 @@ 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(s -> selectCovering(sentenceType, s));
+        select(cas, tokenType).forEach(t -> selectCovering(sentenceType, t));
       })
       .run();
 
-    new Benchmark("JCas indexCovering", template)
-      .measure(() -> indexCovering(cas, getType(cas, TYPE_NAME_TOKEN), getType(cas, TYPE_NAME_SENTENCE)))
+    new Benchmark("CAS selectCovering v3", template)
+      .measure(() -> {
+        Type sentenceType = getType(cas, TYPE_NAME_SENTENCE);
+        Type tokenType = getType(cas, TYPE_NAME_TOKEN);
+        cas.select(tokenType).forEach(t -> cas.select(sentenceType).covering((AnnotationFS) t).forEach(s -> {}));
+      })
+      .run();
+
+    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 49b907c..befc574 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
@@ -123,7 +123,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();
   }
   
@@ -136,11 +136,17 @@ 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 selectCovering v3", template)
+      .measure(() -> {
+          jcas.select(Token.class).forEach(t -> jcas.select(Sentence.class).covering(t).forEach(s -> {}));
+      })
+    .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();
   }
 }