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/09 07:39:02 UTC

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

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



##########
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:
       Sounds good. Accepted. 




----------------------------------------------------------------
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