8311178: JMH tests don't scale well when sharing output buffers

Co-authored-by: Vladimir Ivanov <vaivanov@openjdk.org>
Reviewed-by: ecaspole, sviswanathan, mli
This commit is contained in:
Swati Sharma 2023-07-11 16:14:33 +00:00 committed by Sandhya Viswanathan
parent 00c7f914c6
commit a03a3a43bb
12 changed files with 17 additions and 17 deletions

View file

@ -33,7 +33,7 @@ import java.util.concurrent.TimeUnit;
@Fork(2)
@Measurement(iterations = 6, time = 1)
@Warmup(iterations=4, time = 2)
@State(Scope.Benchmark)
@State(Scope.Thread)
public class DataOutputStreamTest {
public enum BasicType {CHAR, SHORT, INT, STRING}

View file

@ -61,7 +61,7 @@ class MyClass {
}
}
@State(Scope.Benchmark)
@State(Scope.Thread)
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@Warmup(iterations = 10, time = 1)

View file

@ -60,7 +60,7 @@ import java.util.concurrent.TimeUnit;
@Measurement(iterations = 5, time = 2)
@Fork(3)
@OutputTimeUnit(TimeUnit.NANOSECONDS)
@State(Scope.Benchmark)
@State(Scope.Thread)
public class ArrayFiddle {
@Param("999")
public int size;

View file

@ -53,7 +53,7 @@ import org.openjdk.jmh.infra.Blackhole;
@Warmup(iterations = 5, time = 1)
@Measurement(iterations = 5, time = 1)
@Fork(3)
@State(Scope.Benchmark)
@State(Scope.Thread)
public class DateTimeFormatterBench {
private static final TimeZone TIME_ZONE = TimeZone.getTimeZone("UTC");