Skip to content

Commit b7c6d4b

Browse files
committed
benchmark tuning
1 parent f1f55ba commit b7c6d4b

1 file changed

Lines changed: 5 additions & 11 deletions

File tree

src/test/java/benchmark/SchemaTransformerBenchmark.java

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,12 @@
3434
import static com.google.common.io.Resources.getResource;
3535

3636
@State(Scope.Benchmark)
37-
@BenchmarkMode(Mode.Throughput)
38-
@Warmup(iterations = 2)
39-
@Measurement(iterations = 2, timeUnit = TimeUnit.NANOSECONDS)
37+
@BenchmarkMode(Mode.AverageTime)
38+
@Threads(1)
39+
@Warmup(iterations = 2, time = 5)
40+
@Measurement(iterations = 3, time = 10)
4041
@Fork(3)
42+
@OutputTimeUnit(TimeUnit.MILLISECONDS)
4143
public class SchemaTransformerBenchmark {
4244

4345
@State(Scope.Benchmark)
@@ -114,21 +116,13 @@ private String readFromClasspath(String file) throws IOException {
114116
}
115117

116118
@Benchmark
117-
@Measurement(iterations = 1, time = 10)
118-
@Threads(1)
119-
@BenchmarkMode(Mode.AverageTime)
120-
@OutputTimeUnit(TimeUnit.MILLISECONDS)
121119
public GraphQLSchema benchMarkSchemaTransformerAdd(MyState myState) {
122120
GraphQLSchema schema = myState.schema;
123121
return SchemaTransformer.transformSchema(schema, myState.directiveAdder);
124122
}
125123

126124

127125
@Benchmark
128-
@Measurement(iterations = 1, time = 10)
129-
@Threads(1)
130-
@BenchmarkMode(Mode.AverageTime)
131-
@OutputTimeUnit(TimeUnit.MILLISECONDS)
132126
public GraphQLSchema benchMarkSchemaTransformerRemove(MyState myState) {
133127
GraphQLSchema schema = myState.txSchema;
134128
return SchemaTransformer.transformSchema(schema, myState.directiveRemover);

0 commit comments

Comments
 (0)