1
- package benchmark ;
1
+ package performance ;
2
2
3
+ import benchmark .BenchmarkUtils ;
3
4
import graphql .execution .CoercedVariables ;
4
5
import graphql .language .Document ;
5
6
import graphql .normalized .ExecutableNormalizedField ;
6
7
import graphql .normalized .ExecutableNormalizedOperation ;
7
8
import graphql .normalized .ExecutableNormalizedOperationFactory ;
8
9
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 .*;
14
11
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 .*;
25
13
import org .openjdk .jmh .infra .Blackhole ;
26
14
27
15
import java .util .List ;
31
19
@ Warmup (iterations = 2 , time = 5 )
32
20
@ Measurement (iterations = 3 )
33
21
@ Fork (3 )
34
- public class DFSelectionSetBenchmark {
22
+ public class DFSelectionSetPerformance {
35
23
36
24
@ State (Scope .Benchmark )
37
25
public static class MyState {
@@ -44,10 +32,10 @@ public static class MyState {
44
32
@ Setup
45
33
public void setup () {
46
34
try {
47
- String schemaString = BenchmarkUtils .loadResource ("large-schema-2.graphqls" );
35
+ String schemaString = PerformanceTestingUtils .loadResource ("large-schema-2.graphqls" );
48
36
schema = SchemaGenerator .createdMockedSchema (schemaString );
49
37
50
- String query = BenchmarkUtils .loadResource ("large-schema-2-query.graphql" );
38
+ String query = PerformanceTestingUtils .loadResource ("large-schema-2-query.graphql" );
51
39
document = Parser .parse (query );
52
40
53
41
ExecutableNormalizedOperation executableNormalizedOperation = ExecutableNormalizedOperationFactory .createExecutableNormalizedOperation (schema , document , null , CoercedVariables .emptyVariables ());
@@ -89,7 +77,7 @@ public static void mainX(String[] args) throws InterruptedException {
89
77
myState .setup ();
90
78
91
79
while (true ) {
92
- List <SelectedField > selectedFields = new DFSelectionSetBenchmark ().getSelectedFields (myState );
80
+ List <SelectedField > selectedFields = new DFSelectionSetPerformance ().getSelectedFields (myState );
93
81
Thread .sleep (500 );
94
82
}
95
83
}
0 commit comments