You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/05/07 13:27:50 UTC

[GitHub] [calcite] vlsi commented on a change in pull request #1963: [CALCITE-3976] Generify the DefaultEdge class

vlsi commented on a change in pull request #1963:
URL: https://github.com/apache/calcite/pull/1963#discussion_r421502321



##########
File path: ubenchmark/src/jmh/java/org/apache/calcite/benchmarks/DefaultDirectedGraphBenchmark.java
##########
@@ -202,70 +200,14 @@ public boolean removeEdgeBenchmark(GraphState state) {
   @Benchmark
   @BenchmarkMode(Mode.AverageTime)
   @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices10Benchmark(GraphState state) {
-    state.graph.removeAllVertices(state.tenNodes);
-  }
-
-  @Benchmark
-  @BenchmarkMode(Mode.AverageTime)
-  @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices20Benchmark(GraphState state) {
-    state.graph.removeAllVertices(state.twentyNodes);
-  }
-
-  @Benchmark
-  @BenchmarkMode(Mode.AverageTime)
-  @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices30Benchmark(GraphState state) {
-    state.graph.removeAllVertices(state.thirtyNodes);
-  }
-
-  @Benchmark
-  @BenchmarkMode(Mode.AverageTime)
-  @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices40Benchmark(GraphState state) {
-    state.graph.removeAllVertices(state.fortyNodes);
-  }
-
-  @Benchmark
-  @BenchmarkMode(Mode.AverageTime)
-  @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices50Benchmark(GraphState state) {
-    state.graph.removeAllVertices(state.fiftyNodes);
-  }
-
-  @Benchmark
-  @BenchmarkMode(Mode.AverageTime)
-  @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices60Benchmark(GraphState state) {
-    state.graph.removeAllVertices(state.sixtyNodes);
-  }
-
-  @Benchmark
-  @BenchmarkMode(Mode.AverageTime)
-  @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices70Benchmark(GraphState state) {
-    state.graph.removeAllVertices(state.seventyNodes);
-  }
-
-  @Benchmark
-  @BenchmarkMode(Mode.AverageTime)
-  @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices80Benchmark(GraphState state) {
-    state.graph.removeAllVertices(state.eightyNodes);
-  }
-
-  @Benchmark
-  @BenchmarkMode(Mode.AverageTime)
-  @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices90Benchmark(GraphState state) {
-    state.graph.removeAllVertices(state.ninetyNodes);
+  public void removeVerticesBenchmark(GraphRemoveState state) {
+    state.innerState.graph.removeAllVertices(state.nodesToRemove);
   }
 
   @Benchmark
   @BenchmarkMode(Mode.AverageTime)
   @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices100Benchmark(GraphState state) {
+  public void removeAllVerticesBenchmark(GraphState state) {

Review comment:
       Just a minor note: `removeAllVerticesBenchmark ` -> `removeAllVertices` so the output is easier to read.

##########
File path: ubenchmark/src/jmh/java/org/apache/calcite/benchmarks/DefaultDirectedGraphBenchmark.java
##########
@@ -202,70 +200,14 @@ public boolean removeEdgeBenchmark(GraphState state) {
   @Benchmark
   @BenchmarkMode(Mode.AverageTime)
   @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices10Benchmark(GraphState state) {
-    state.graph.removeAllVertices(state.tenNodes);
-  }
-
-  @Benchmark
-  @BenchmarkMode(Mode.AverageTime)
-  @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices20Benchmark(GraphState state) {
-    state.graph.removeAllVertices(state.twentyNodes);
-  }
-
-  @Benchmark
-  @BenchmarkMode(Mode.AverageTime)
-  @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices30Benchmark(GraphState state) {
-    state.graph.removeAllVertices(state.thirtyNodes);
-  }
-
-  @Benchmark
-  @BenchmarkMode(Mode.AverageTime)
-  @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices40Benchmark(GraphState state) {
-    state.graph.removeAllVertices(state.fortyNodes);
-  }
-
-  @Benchmark
-  @BenchmarkMode(Mode.AverageTime)
-  @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices50Benchmark(GraphState state) {
-    state.graph.removeAllVertices(state.fiftyNodes);
-  }
-
-  @Benchmark
-  @BenchmarkMode(Mode.AverageTime)
-  @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices60Benchmark(GraphState state) {
-    state.graph.removeAllVertices(state.sixtyNodes);
-  }
-
-  @Benchmark
-  @BenchmarkMode(Mode.AverageTime)
-  @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices70Benchmark(GraphState state) {
-    state.graph.removeAllVertices(state.seventyNodes);
-  }
-
-  @Benchmark
-  @BenchmarkMode(Mode.AverageTime)
-  @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices80Benchmark(GraphState state) {
-    state.graph.removeAllVertices(state.eightyNodes);
-  }
-
-  @Benchmark
-  @BenchmarkMode(Mode.AverageTime)
-  @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices90Benchmark(GraphState state) {
-    state.graph.removeAllVertices(state.ninetyNodes);
+  public void removeVerticesBenchmark(GraphRemoveState state) {
+    state.innerState.graph.removeAllVertices(state.nodesToRemove);
   }
 
   @Benchmark
   @BenchmarkMode(Mode.AverageTime)
   @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices100Benchmark(GraphState state) {
+  public void removeAllVerticesBenchmark(GraphState state) {

Review comment:
       Just a minor note: `removeAllVerticesBenchmark ` -> `removeAllVertices` so the output is easier to read.
   ```suggestion
     public void removeAllVertices(GraphState state) {
   ```

##########
File path: ubenchmark/src/jmh/java/org/apache/calcite/benchmarks/DefaultDirectedGraphBenchmark.java
##########
@@ -202,70 +200,14 @@ public boolean removeEdgeBenchmark(GraphState state) {
   @Benchmark
   @BenchmarkMode(Mode.AverageTime)
   @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices10Benchmark(GraphState state) {
-    state.graph.removeAllVertices(state.tenNodes);
-  }
-
-  @Benchmark
-  @BenchmarkMode(Mode.AverageTime)
-  @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices20Benchmark(GraphState state) {
-    state.graph.removeAllVertices(state.twentyNodes);
-  }
-
-  @Benchmark
-  @BenchmarkMode(Mode.AverageTime)
-  @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices30Benchmark(GraphState state) {
-    state.graph.removeAllVertices(state.thirtyNodes);
-  }
-
-  @Benchmark
-  @BenchmarkMode(Mode.AverageTime)
-  @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices40Benchmark(GraphState state) {
-    state.graph.removeAllVertices(state.fortyNodes);
-  }
-
-  @Benchmark
-  @BenchmarkMode(Mode.AverageTime)
-  @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices50Benchmark(GraphState state) {
-    state.graph.removeAllVertices(state.fiftyNodes);
-  }
-
-  @Benchmark
-  @BenchmarkMode(Mode.AverageTime)
-  @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices60Benchmark(GraphState state) {
-    state.graph.removeAllVertices(state.sixtyNodes);
-  }
-
-  @Benchmark
-  @BenchmarkMode(Mode.AverageTime)
-  @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices70Benchmark(GraphState state) {
-    state.graph.removeAllVertices(state.seventyNodes);
-  }
-
-  @Benchmark
-  @BenchmarkMode(Mode.AverageTime)
-  @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices80Benchmark(GraphState state) {
-    state.graph.removeAllVertices(state.eightyNodes);
-  }
-
-  @Benchmark
-  @BenchmarkMode(Mode.AverageTime)
-  @OutputTimeUnit(TimeUnit.MICROSECONDS)
-  public void removeAllVertices90Benchmark(GraphState state) {
-    state.graph.removeAllVertices(state.ninetyNodes);
+  public void removeVerticesBenchmark(GraphRemoveState state) {

Review comment:
       ```suggestion
     public void removeVertices(GraphRemoveState state) {
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org