Skip to content

Commit 55062e4

Browse files
committed
Move DFSelectionSetBenchmark to performance suite
1 parent 8aa04f6 commit 55062e4

File tree

1 file changed

+8
-20
lines changed

1 file changed

+8
-20
lines changed

src/test/java/benchmark/DFSelectionSetBenchmark.java renamed to src/test/java/performance/DFSelectionSetPerformance.java

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,15 @@
1-
package benchmark;
1+
package performance;
22

3+
import benchmark.BenchmarkUtils;
34
import graphql.execution.CoercedVariables;
45
import graphql.language.Document;
56
import graphql.normalized.ExecutableNormalizedField;
67
import graphql.normalized.ExecutableNormalizedOperation;
78
import graphql.normalized.ExecutableNormalizedOperationFactory;
89
import graphql.parser.Parser;
9-
import graphql.schema.DataFetchingFieldSelectionSet;
10-
import graphql.schema.DataFetchingFieldSelectionSetImpl;
11-
import graphql.schema.GraphQLOutputType;
12-
import graphql.schema.GraphQLSchema;
13-
import graphql.schema.SelectedField;
10+
import graphql.schema.*;
1411
import graphql.schema.idl.SchemaGenerator;
15-
import org.openjdk.jmh.annotations.Benchmark;
16-
import org.openjdk.jmh.annotations.BenchmarkMode;
17-
import org.openjdk.jmh.annotations.Fork;
18-
import org.openjdk.jmh.annotations.Measurement;
19-
import org.openjdk.jmh.annotations.Mode;
20-
import org.openjdk.jmh.annotations.OutputTimeUnit;
21-
import org.openjdk.jmh.annotations.Scope;
22-
import org.openjdk.jmh.annotations.Setup;
23-
import org.openjdk.jmh.annotations.State;
24-
import org.openjdk.jmh.annotations.Warmup;
12+
import org.openjdk.jmh.annotations.*;
2513
import org.openjdk.jmh.infra.Blackhole;
2614

2715
import java.util.List;
@@ -31,7 +19,7 @@
3119
@Warmup(iterations = 2, time = 5)
3220
@Measurement(iterations = 3)
3321
@Fork(3)
34-
public class DFSelectionSetBenchmark {
22+
public class DFSelectionSetPerformance {
3523

3624
@State(Scope.Benchmark)
3725
public static class MyState {
@@ -44,10 +32,10 @@ public static class MyState {
4432
@Setup
4533
public void setup() {
4634
try {
47-
String schemaString = BenchmarkUtils.loadResource("large-schema-2.graphqls");
35+
String schemaString = PerformanceTestingUtils.loadResource("large-schema-2.graphqls");
4836
schema = SchemaGenerator.createdMockedSchema(schemaString);
4937

50-
String query = BenchmarkUtils.loadResource("large-schema-2-query.graphql");
38+
String query = PerformanceTestingUtils.loadResource("large-schema-2-query.graphql");
5139
document = Parser.parse(query);
5240

5341
ExecutableNormalizedOperation executableNormalizedOperation = ExecutableNormalizedOperationFactory.createExecutableNormalizedOperation(schema, document, null, CoercedVariables.emptyVariables());
@@ -89,7 +77,7 @@ public static void mainX(String[] args) throws InterruptedException {
8977
myState.setup();
9078

9179
while (true) {
92-
List<SelectedField> selectedFields = new DFSelectionSetBenchmark().getSelectedFields(myState);
80+
List<SelectedField> selectedFields = new DFSelectionSetPerformance().getSelectedFields(myState);
9381
Thread.sleep(500);
9482
}
9583
}

0 commit comments

Comments
 (0)