beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhalp...@apache.org
Subject [13/19] incubator-beam git commit: Port microbenchmarks to new vocabulary
Date Thu, 04 Aug 2016 01:26:21 GMT
Port microbenchmarks to new vocabulary


Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/e07c3397
Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/e07c3397
Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/e07c3397

Branch: refs/heads/master
Commit: e07c3397d268f50cc879362227a6887cc52f4a3b
Parents: 3236eec
Author: Kenneth Knowles <klk@google.com>
Authored: Fri Jul 22 14:29:51 2016 -0700
Committer: Dan Halperin <dhalperi@google.com>
Committed: Wed Aug 3 18:25:53 2016 -0700

----------------------------------------------------------------------
 .../transforms/DoFnReflectorBenchmark.java      | 27 ++++++++++----------
 1 file changed, 14 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/e07c3397/sdks/java/microbenchmarks/src/main/java/org/apache/beam/sdk/microbenchmarks/transforms/DoFnReflectorBenchmark.java
----------------------------------------------------------------------
diff --git a/sdks/java/microbenchmarks/src/main/java/org/apache/beam/sdk/microbenchmarks/transforms/DoFnReflectorBenchmark.java
b/sdks/java/microbenchmarks/src/main/java/org/apache/beam/sdk/microbenchmarks/transforms/DoFnReflectorBenchmark.java
index fd75e95..233b8be 100644
--- a/sdks/java/microbenchmarks/src/main/java/org/apache/beam/sdk/microbenchmarks/transforms/DoFnReflectorBenchmark.java
+++ b/sdks/java/microbenchmarks/src/main/java/org/apache/beam/sdk/microbenchmarks/transforms/DoFnReflectorBenchmark.java
@@ -53,9 +53,10 @@ public class DoFnReflectorBenchmark {
   private OldDoFn<String, String> oldDoFn = new UpperCaseOldDoFn();
   private DoFn<String, String> doFn = new UpperCaseDoFn();
 
-  private StubDoFnProcessContext stubDoFnContext = new StubDoFnProcessContext(oldDoFn, ELEMENT);
-  private StubDoFnWithContextProcessContext stubDoFnWithContextContext =
-      new StubDoFnWithContextProcessContext(doFn, ELEMENT);
+  private StubOldDoFnProcessContext stubOldDoFnContext = new StubOldDoFnProcessContext(oldDoFn,
+      ELEMENT);
+  private StubDoFnProcessContext stubDoFnContext =
+      new StubDoFnProcessContext(doFn, ELEMENT);
   private ExtraContextFactory<String, String> extraContextFactory =
       new ExtraContextFactory<String, String>() {
 
@@ -83,21 +84,21 @@ public class DoFnReflectorBenchmark {
   }
 
   @Benchmark
-  public String invokeDoFn() throws Exception {
-    oldDoFn.processElement(stubDoFnContext);
+  public String invokeOldDoFn() throws Exception {
+    oldDoFn.processElement(stubOldDoFnContext);
     return stubDoFnContext.output;
   }
 
   @Benchmark
   public String invokeDoFnWithContextViaAdaptor() throws Exception {
-    adaptedDoFnWithContext.processElement(stubDoFnContext);
-    return stubDoFnContext.output;
+    adaptedDoFnWithContext.processElement(stubOldDoFnContext);
+    return stubOldDoFnContext.output;
   }
 
   @Benchmark
   public String invokeDoFnWithContext() throws Exception {
-    invoker.invokeProcessElement(stubDoFnWithContextContext, extraContextFactory);
-    return stubDoFnWithContextContext.output;
+    invoker.invokeProcessElement(stubDoFnContext, extraContextFactory);
+    return stubDoFnContext.output;
   }
 
   private static class UpperCaseOldDoFn extends OldDoFn<String, String> {
@@ -116,12 +117,12 @@ public class DoFnReflectorBenchmark {
     }
   }
 
-  private static class StubDoFnProcessContext extends OldDoFn<String, String>.ProcessContext
{
+  private static class StubOldDoFnProcessContext extends OldDoFn<String, String>.ProcessContext
{
 
     private final String element;
     private String output;
 
-    public StubDoFnProcessContext(OldDoFn<String, String> fn, String element) {
+    public StubOldDoFnProcessContext(OldDoFn<String, String> fn, String element) {
       fn.super();
       this.element = element;
     }
@@ -186,12 +187,12 @@ public class DoFnReflectorBenchmark {
     }
   }
 
-  private static class StubDoFnWithContextProcessContext
+  private static class StubDoFnProcessContext
       extends DoFn<String, String>.ProcessContext {
     private final String element;
     private  String output;
 
-    public StubDoFnWithContextProcessContext(DoFn<String, String> fn, String element)
{
+    public StubDoFnProcessContext(DoFn<String, String> fn, String element) {
       fn.super();
       this.element = element;
     }


Mime
View raw message