From b438cffdb9821fce86d215e452b41810b08b3e71 Mon Sep 17 00:00:00 2001 From: Swati Sharma Date: Tue, 3 Oct 2023 16:01:36 +0000 Subject: [PATCH] 8314085: Fixing scope from benchmark to thread for JMH tests having shared state Co-authored-by: Vladimir Ivanov Reviewed-by: sviswanathan, ecaspole --- .../bench/java/io/DataInputStreamTest.java | 2 +- .../openjdk/bench/java/lang/ArrayClone.java | 2 +- .../lang/StringCompareToDifferentLength.java | 2 +- .../java/lang/StringCompareToIgnoreCase.java | 2 +- .../bench/java/lang/StringComparisons.java | 2 +- .../openjdk/bench/java/lang/StringEquals.java | 2 +- .../openjdk/bench/java/lang/StringFormat.java | 2 +- .../openjdk/bench/java/lang/StringReplace.java | 2 +- .../bench/java/lang/StringSubstring.java | 2 +- .../bench/java/lang/StringTemplateFMT.java | 2 +- .../lang/constant/MethodTypeDescFactories.java | 2 +- .../constant/ReferenceClassDescResolve.java | 2 +- .../lang/invoke/MethodHandlesConstant.java | 2 +- .../lang/invoke/MethodHandlesIdentity.java | 2 +- .../invoke/MethodHandlesThrowException.java | 2 +- .../lang/invoke/MethodTypeAppendParams.java | 2 +- .../lang/invoke/MethodTypeChangeParam.java | 2 +- .../lang/invoke/MethodTypeChangeReturn.java | 2 +- .../java/lang/invoke/MethodTypeDropParams.java | 2 +- .../java/lang/invoke/MethodTypeGenerify.java | 2 +- .../lang/invoke/MethodTypeInsertParams.java | 2 +- .../bench/java/security/CipherSuiteBench.java | 2 +- .../openjdk/bench/java/time/GetYearBench.java | 2 +- .../openjdk/bench/java/time/InstantBench.java | 2 +- .../DateTimeFormatterWithPaddingBench.java | 2 +- .../org/openjdk/bench/java/util/ListArgs.java | 2 +- .../bench/java/util/LocaleDefaults.java | 2 +- .../openjdk/bench/java/util/TestAdler32.java | 2 +- .../org/openjdk/bench/java/util/TestCRC32.java | 2 +- .../openjdk/bench/java/util/TestCRC32C.java | 2 +- .../bench/java/util/regex/Exponential.java | 2 +- .../bench/java/util/regex/Primality.java | 2 +- .../openjdk/bench/java/util/regex/Trim.java | 2 +- .../openjdk/bench/javax/crypto/AESReinit.java | 2 +- .../vector/LoadMaskedIOOBEBenchmark.java | 2 +- .../openjdk/bench/vm/compiler/Rotation.java | 2 +- .../bench/vm/compiler/x86/BasicRules.java | 2 +- .../bench/vm/compiler/x86/ConvertF2I.java | 18 +++++++++--------- 38 files changed, 46 insertions(+), 46 deletions(-) diff --git a/test/micro/org/openjdk/bench/java/io/DataInputStreamTest.java b/test/micro/org/openjdk/bench/java/io/DataInputStreamTest.java index a15879f27cd..3856cea22ef 100644 --- a/test/micro/org/openjdk/bench/java/io/DataInputStreamTest.java +++ b/test/micro/org/openjdk/bench/java/io/DataInputStreamTest.java @@ -36,7 +36,7 @@ import java.util.concurrent.TimeUnit; @Fork(value = 4, warmups = 0) @Measurement(iterations = 5, time = 1) @Warmup(iterations = 2, time = 2) -@State(Scope.Benchmark) +@State(Scope.Thread) public class DataInputStreamTest { private final int size = 1024; diff --git a/test/micro/org/openjdk/bench/java/lang/ArrayClone.java b/test/micro/org/openjdk/bench/java/lang/ArrayClone.java index 32c81f945fe..945637bf31c 100644 --- a/test/micro/org/openjdk/bench/java/lang/ArrayClone.java +++ b/test/micro/org/openjdk/bench/java/lang/ArrayClone.java @@ -46,7 +46,7 @@ import org.openjdk.jmh.runner.options.OptionsBuilder; @Warmup(iterations = 2, time = 3, timeUnit = TimeUnit.SECONDS) @Measurement(iterations = 15, time = 1, timeUnit = TimeUnit.SECONDS) @Fork(1) -@State(Scope.Benchmark) +@State(Scope.Thread) public class ArrayClone { @Param({"0", "10", "100", "1000"}) diff --git a/test/micro/org/openjdk/bench/java/lang/StringCompareToDifferentLength.java b/test/micro/org/openjdk/bench/java/lang/StringCompareToDifferentLength.java index 74d304a3ca5..16cb6ba54d1 100644 --- a/test/micro/org/openjdk/bench/java/lang/StringCompareToDifferentLength.java +++ b/test/micro/org/openjdk/bench/java/lang/StringCompareToDifferentLength.java @@ -51,7 +51,7 @@ import org.openjdk.jmh.infra.Blackhole; @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.MILLISECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) @Measurement(iterations = 3, time = 1000, timeUnit = TimeUnit.MILLISECONDS) @Warmup(iterations = 3, time = 1000, timeUnit = TimeUnit.MILLISECONDS) @Fork(3) diff --git a/test/micro/org/openjdk/bench/java/lang/StringCompareToIgnoreCase.java b/test/micro/org/openjdk/bench/java/lang/StringCompareToIgnoreCase.java index 1270112f47d..82439b7c536 100644 --- a/test/micro/org/openjdk/bench/java/lang/StringCompareToIgnoreCase.java +++ b/test/micro/org/openjdk/bench/java/lang/StringCompareToIgnoreCase.java @@ -30,7 +30,7 @@ import java.util.concurrent.TimeUnit; */ @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) @Warmup(iterations = 5, time = 1) @Measurement(iterations = 5, time = 1) @Fork(3) diff --git a/test/micro/org/openjdk/bench/java/lang/StringComparisons.java b/test/micro/org/openjdk/bench/java/lang/StringComparisons.java index b18b56bee2a..eb50731decd 100644 --- a/test/micro/org/openjdk/bench/java/lang/StringComparisons.java +++ b/test/micro/org/openjdk/bench/java/lang/StringComparisons.java @@ -32,7 +32,7 @@ import java.util.concurrent.TimeUnit; */ @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) @Warmup(iterations = 5, time = 1) @Measurement(iterations = 5, time = 1) @Fork(value = 3) diff --git a/test/micro/org/openjdk/bench/java/lang/StringEquals.java b/test/micro/org/openjdk/bench/java/lang/StringEquals.java index 7d727344055..b0db6a7037e 100644 --- a/test/micro/org/openjdk/bench/java/lang/StringEquals.java +++ b/test/micro/org/openjdk/bench/java/lang/StringEquals.java @@ -30,7 +30,7 @@ import java.util.concurrent.TimeUnit; */ @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) @Warmup(iterations = 5, time = 1) @Measurement(iterations = 5, time = 1) @Fork(value = 3) diff --git a/test/micro/org/openjdk/bench/java/lang/StringFormat.java b/test/micro/org/openjdk/bench/java/lang/StringFormat.java index e0bab83bcb3..9f462a91e33 100644 --- a/test/micro/org/openjdk/bench/java/lang/StringFormat.java +++ b/test/micro/org/openjdk/bench/java/lang/StringFormat.java @@ -39,7 +39,7 @@ import java.util.concurrent.TimeUnit; */ @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) @Warmup(iterations = 5, time = 1) @Measurement(iterations = 5, time = 1) @Fork(value = 3) diff --git a/test/micro/org/openjdk/bench/java/lang/StringReplace.java b/test/micro/org/openjdk/bench/java/lang/StringReplace.java index 80a90e15ffb..53101b0ba20 100644 --- a/test/micro/org/openjdk/bench/java/lang/StringReplace.java +++ b/test/micro/org/openjdk/bench/java/lang/StringReplace.java @@ -28,7 +28,7 @@ import java.util.concurrent.TimeUnit; @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) @Warmup(iterations = 5, time = 1) @Measurement(iterations = 5, time = 1) @Fork(value = 3) diff --git a/test/micro/org/openjdk/bench/java/lang/StringSubstring.java b/test/micro/org/openjdk/bench/java/lang/StringSubstring.java index c0bbfbc7320..da7c0b4aba2 100644 --- a/test/micro/org/openjdk/bench/java/lang/StringSubstring.java +++ b/test/micro/org/openjdk/bench/java/lang/StringSubstring.java @@ -31,7 +31,7 @@ import java.util.concurrent.TimeUnit; @Fork(value = 3) @Warmup(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS) @Measurement(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) public class StringSubstring { public String s = new String("An arbitrary string that happened to be of length 52"); diff --git a/test/micro/org/openjdk/bench/java/lang/StringTemplateFMT.java b/test/micro/org/openjdk/bench/java/lang/StringTemplateFMT.java index bd730f9ef87..60a3024c7f8 100644 --- a/test/micro/org/openjdk/bench/java/lang/StringTemplateFMT.java +++ b/test/micro/org/openjdk/bench/java/lang/StringTemplateFMT.java @@ -42,7 +42,7 @@ import static java.util.FormatProcessor.FMT; */ @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) @Warmup(iterations = 5, time = 1) @Measurement(iterations = 5, time = 1) @Fork(value = 3, jvmArgsAppend = "--enable-preview") diff --git a/test/micro/org/openjdk/bench/java/lang/constant/MethodTypeDescFactories.java b/test/micro/org/openjdk/bench/java/lang/constant/MethodTypeDescFactories.java index 27669e37e29..b9614fccfd2 100644 --- a/test/micro/org/openjdk/bench/java/lang/constant/MethodTypeDescFactories.java +++ b/test/micro/org/openjdk/bench/java/lang/constant/MethodTypeDescFactories.java @@ -49,7 +49,7 @@ import java.util.concurrent.TimeUnit; @Warmup(iterations = 3, time = 2) @Measurement(iterations = 6, time = 1) @Fork(1) -@State(Scope.Benchmark) +@State(Scope.Thread) public class MethodTypeDescFactories { private static final ClassDesc DUMMY_CD = ClassDesc.of("Dummy_invalid"); diff --git a/test/micro/org/openjdk/bench/java/lang/constant/ReferenceClassDescResolve.java b/test/micro/org/openjdk/bench/java/lang/constant/ReferenceClassDescResolve.java index 6d6c49fbb0b..528d370f54a 100644 --- a/test/micro/org/openjdk/bench/java/lang/constant/ReferenceClassDescResolve.java +++ b/test/micro/org/openjdk/bench/java/lang/constant/ReferenceClassDescResolve.java @@ -47,7 +47,7 @@ import static java.lang.constant.ConstantDescs.*; @Warmup(iterations = 3, time = 2) @Measurement(iterations = 6, time = 1) @Fork(1) -@State(Scope.Benchmark) +@State(Scope.Thread) public class ReferenceClassDescResolve { private static final MethodHandles.Lookup LOOKUP = MethodHandles.lookup(); private static final ClassDesc CLASS_OR_INTERFACE = CD_String; diff --git a/test/micro/org/openjdk/bench/java/lang/invoke/MethodHandlesConstant.java b/test/micro/org/openjdk/bench/java/lang/invoke/MethodHandlesConstant.java index f2464a7eed8..130d355ba2c 100644 --- a/test/micro/org/openjdk/bench/java/lang/invoke/MethodHandlesConstant.java +++ b/test/micro/org/openjdk/bench/java/lang/invoke/MethodHandlesConstant.java @@ -42,7 +42,7 @@ import java.util.concurrent.TimeUnit; */ @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) @Warmup(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS) @Measurement(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS) @Fork(3) diff --git a/test/micro/org/openjdk/bench/java/lang/invoke/MethodHandlesIdentity.java b/test/micro/org/openjdk/bench/java/lang/invoke/MethodHandlesIdentity.java index c7083442448..3ee48a4674f 100644 --- a/test/micro/org/openjdk/bench/java/lang/invoke/MethodHandlesIdentity.java +++ b/test/micro/org/openjdk/bench/java/lang/invoke/MethodHandlesIdentity.java @@ -42,7 +42,7 @@ import java.util.concurrent.TimeUnit; */ @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) @Warmup(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS) @Measurement(iterations = 5, time = 2, timeUnit = TimeUnit.SECONDS) @Fork(3) diff --git a/test/micro/org/openjdk/bench/java/lang/invoke/MethodHandlesThrowException.java b/test/micro/org/openjdk/bench/java/lang/invoke/MethodHandlesThrowException.java index ff7c8a56fa9..5239597555b 100644 --- a/test/micro/org/openjdk/bench/java/lang/invoke/MethodHandlesThrowException.java +++ b/test/micro/org/openjdk/bench/java/lang/invoke/MethodHandlesThrowException.java @@ -42,7 +42,7 @@ import java.util.concurrent.TimeUnit; */ @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) @Warmup(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS) @Measurement(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS) @Fork(3) diff --git a/test/micro/org/openjdk/bench/java/lang/invoke/MethodTypeAppendParams.java b/test/micro/org/openjdk/bench/java/lang/invoke/MethodTypeAppendParams.java index ba47a77b98e..bc37f4cef8b 100644 --- a/test/micro/org/openjdk/bench/java/lang/invoke/MethodTypeAppendParams.java +++ b/test/micro/org/openjdk/bench/java/lang/invoke/MethodTypeAppendParams.java @@ -41,7 +41,7 @@ import java.util.concurrent.TimeUnit; */ @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) @Warmup(iterations = 10, time = 1, timeUnit = TimeUnit.SECONDS) @Measurement(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS) @Fork(3) diff --git a/test/micro/org/openjdk/bench/java/lang/invoke/MethodTypeChangeParam.java b/test/micro/org/openjdk/bench/java/lang/invoke/MethodTypeChangeParam.java index a005ae123a9..76a25a847cd 100644 --- a/test/micro/org/openjdk/bench/java/lang/invoke/MethodTypeChangeParam.java +++ b/test/micro/org/openjdk/bench/java/lang/invoke/MethodTypeChangeParam.java @@ -41,7 +41,7 @@ import java.util.concurrent.TimeUnit; */ @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) @Warmup(iterations = 10, time = 1, timeUnit = TimeUnit.SECONDS) @Measurement(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS) @Fork(3) diff --git a/test/micro/org/openjdk/bench/java/lang/invoke/MethodTypeChangeReturn.java b/test/micro/org/openjdk/bench/java/lang/invoke/MethodTypeChangeReturn.java index 677c6c971cc..6850ab0cb3c 100644 --- a/test/micro/org/openjdk/bench/java/lang/invoke/MethodTypeChangeReturn.java +++ b/test/micro/org/openjdk/bench/java/lang/invoke/MethodTypeChangeReturn.java @@ -41,7 +41,7 @@ import java.util.concurrent.TimeUnit; */ @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) @Warmup(iterations = 10, time = 1, timeUnit = TimeUnit.SECONDS) @Measurement(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS) @Fork(3) diff --git a/test/micro/org/openjdk/bench/java/lang/invoke/MethodTypeDropParams.java b/test/micro/org/openjdk/bench/java/lang/invoke/MethodTypeDropParams.java index 80df4349fcb..2ae11ddcc44 100644 --- a/test/micro/org/openjdk/bench/java/lang/invoke/MethodTypeDropParams.java +++ b/test/micro/org/openjdk/bench/java/lang/invoke/MethodTypeDropParams.java @@ -41,7 +41,7 @@ import java.util.concurrent.TimeUnit; */ @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) @Warmup(iterations = 10, time = 1, timeUnit = TimeUnit.SECONDS) @Measurement(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS) @Fork(3) diff --git a/test/micro/org/openjdk/bench/java/lang/invoke/MethodTypeGenerify.java b/test/micro/org/openjdk/bench/java/lang/invoke/MethodTypeGenerify.java index de64a2adaaa..7cda41659f3 100644 --- a/test/micro/org/openjdk/bench/java/lang/invoke/MethodTypeGenerify.java +++ b/test/micro/org/openjdk/bench/java/lang/invoke/MethodTypeGenerify.java @@ -41,7 +41,7 @@ import java.util.concurrent.TimeUnit; */ @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) @Warmup(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS) @Measurement(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS) @Fork(3) diff --git a/test/micro/org/openjdk/bench/java/lang/invoke/MethodTypeInsertParams.java b/test/micro/org/openjdk/bench/java/lang/invoke/MethodTypeInsertParams.java index 213c6497c16..e4555dfeabb 100644 --- a/test/micro/org/openjdk/bench/java/lang/invoke/MethodTypeInsertParams.java +++ b/test/micro/org/openjdk/bench/java/lang/invoke/MethodTypeInsertParams.java @@ -41,7 +41,7 @@ import java.util.concurrent.TimeUnit; */ @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) @Warmup(iterations = 10, time = 1, timeUnit = TimeUnit.SECONDS) @Measurement(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS) @Fork(3) diff --git a/test/micro/org/openjdk/bench/java/security/CipherSuiteBench.java b/test/micro/org/openjdk/bench/java/security/CipherSuiteBench.java index e37cec895ca..dcda7c252f0 100644 --- a/test/micro/org/openjdk/bench/java/security/CipherSuiteBench.java +++ b/test/micro/org/openjdk/bench/java/security/CipherSuiteBench.java @@ -31,7 +31,7 @@ import java.util.concurrent.TimeUnit; @Fork(value = 3, jvmArgsAppend = {"--add-exports", "java.base/sun.security.ssl=ALL-UNNAMED", "--add-opens", "java.base/sun.security.ssl=ALL-UNNAMED"}) -@State(Scope.Benchmark) +@State(Scope.Thread) @OutputTimeUnit(TimeUnit.MICROSECONDS) @BenchmarkMode(Mode.Throughput) @Warmup(iterations = 5, time = 1) diff --git a/test/micro/org/openjdk/bench/java/time/GetYearBench.java b/test/micro/org/openjdk/bench/java/time/GetYearBench.java index dc83a9c770c..64d4a468b90 100644 --- a/test/micro/org/openjdk/bench/java/time/GetYearBench.java +++ b/test/micro/org/openjdk/bench/java/time/GetYearBench.java @@ -58,7 +58,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 GetYearBench { private TimeZone UTC = TimeZone.getTimeZone("UTC"); diff --git a/test/micro/org/openjdk/bench/java/time/InstantBench.java b/test/micro/org/openjdk/bench/java/time/InstantBench.java index 0ceea68425d..0fe408a6b00 100644 --- a/test/micro/org/openjdk/bench/java/time/InstantBench.java +++ b/test/micro/org/openjdk/bench/java/time/InstantBench.java @@ -50,7 +50,7 @@ import org.openjdk.jmh.annotations.Warmup; @Warmup(iterations = 5, time = 1) @Measurement(iterations = 5, time = 1) @Fork(3) -@State(Scope.Benchmark) +@State(Scope.Thread) public class InstantBench { private Instant[] INSTANTS; diff --git a/test/micro/org/openjdk/bench/java/time/format/DateTimeFormatterWithPaddingBench.java b/test/micro/org/openjdk/bench/java/time/format/DateTimeFormatterWithPaddingBench.java index a0aeb77839b..478bc7a851b 100644 --- a/test/micro/org/openjdk/bench/java/time/format/DateTimeFormatterWithPaddingBench.java +++ b/test/micro/org/openjdk/bench/java/time/format/DateTimeFormatterWithPaddingBench.java @@ -36,7 +36,7 @@ import java.util.concurrent.TimeUnit; @Warmup(iterations = 5, time = 1) @Measurement(iterations = 5, time = 1) @Fork(3) -@State(Scope.Benchmark) +@State(Scope.Thread) public class DateTimeFormatterWithPaddingBench { private static final DateTimeFormatter FORMATTER_WITH_PADDING = new DateTimeFormatterBuilder() diff --git a/test/micro/org/openjdk/bench/java/util/ListArgs.java b/test/micro/org/openjdk/bench/java/util/ListArgs.java index a3e19271259..073214ce2a1 100644 --- a/test/micro/org/openjdk/bench/java/util/ListArgs.java +++ b/test/micro/org/openjdk/bench/java/util/ListArgs.java @@ -34,7 +34,7 @@ import java.util.concurrent.TimeUnit; * initializers. Use parallel GC and set initial heap size to avoid * GC during runs. */ -@State(Scope.Benchmark) +@State(Scope.Thread) @OutputTimeUnit(TimeUnit.MILLISECONDS) @Fork(value = 3, jvmArgsAppend = { "-verbose:gc", "-XX:+UseParallelGC", "-Xms4g", "-Xmx4g", "-Xint" }) @Warmup(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS) diff --git a/test/micro/org/openjdk/bench/java/util/LocaleDefaults.java b/test/micro/org/openjdk/bench/java/util/LocaleDefaults.java index 8e92f3d142f..b2cb35e24bf 100644 --- a/test/micro/org/openjdk/bench/java/util/LocaleDefaults.java +++ b/test/micro/org/openjdk/bench/java/util/LocaleDefaults.java @@ -40,7 +40,7 @@ import java.util.concurrent.TimeUnit; */ @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) @Warmup(iterations = 4, time = 2) @Measurement(iterations = 4, time = 2) @Fork(value = 3) diff --git a/test/micro/org/openjdk/bench/java/util/TestAdler32.java b/test/micro/org/openjdk/bench/java/util/TestAdler32.java index 9f3c090ecbf..b9a43d39d68 100644 --- a/test/micro/org/openjdk/bench/java/util/TestAdler32.java +++ b/test/micro/org/openjdk/bench/java/util/TestAdler32.java @@ -29,7 +29,7 @@ import org.openjdk.jmh.annotations.*; @BenchmarkMode(Mode.Throughput) @OutputTimeUnit(TimeUnit.MILLISECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) public class TestAdler32 { private Adler32 adler32; diff --git a/test/micro/org/openjdk/bench/java/util/TestCRC32.java b/test/micro/org/openjdk/bench/java/util/TestCRC32.java index 241e507a80c..4bff8d4fc42 100644 --- a/test/micro/org/openjdk/bench/java/util/TestCRC32.java +++ b/test/micro/org/openjdk/bench/java/util/TestCRC32.java @@ -29,7 +29,7 @@ import org.openjdk.jmh.annotations.*; @BenchmarkMode(Mode.Throughput) @OutputTimeUnit(TimeUnit.MILLISECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) @Warmup(iterations = 4, time = 2) @Measurement(iterations = 4, time = 2) @Fork(value = 3) diff --git a/test/micro/org/openjdk/bench/java/util/TestCRC32C.java b/test/micro/org/openjdk/bench/java/util/TestCRC32C.java index f007b254f02..d6aa8e4c6c9 100644 --- a/test/micro/org/openjdk/bench/java/util/TestCRC32C.java +++ b/test/micro/org/openjdk/bench/java/util/TestCRC32C.java @@ -29,7 +29,7 @@ import org.openjdk.jmh.annotations.*; @BenchmarkMode(Mode.Throughput) @OutputTimeUnit(TimeUnit.MILLISECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) @Warmup(iterations = 4, time = 2) @Measurement(iterations = 4, time = 2) @Fork(value = 3) diff --git a/test/micro/org/openjdk/bench/java/util/regex/Exponential.java b/test/micro/org/openjdk/bench/java/util/regex/Exponential.java index cf8741e490d..1ab341fc17d 100644 --- a/test/micro/org/openjdk/bench/java/util/regex/Exponential.java +++ b/test/micro/org/openjdk/bench/java/util/regex/Exponential.java @@ -47,7 +47,7 @@ import java.util.regex.Pattern; @Fork(2) @Warmup(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS) @Measurement(iterations = 5, time = 1, timeUnit = TimeUnit.SECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) public class Exponential { /** Run length of non-matching consecutive whitespace chars. */ @Param({"16", "128", "1024"}) diff --git a/test/micro/org/openjdk/bench/java/util/regex/Primality.java b/test/micro/org/openjdk/bench/java/util/regex/Primality.java index b33836d838b..6487e8861a3 100644 --- a/test/micro/org/openjdk/bench/java/util/regex/Primality.java +++ b/test/micro/org/openjdk/bench/java/util/regex/Primality.java @@ -47,7 +47,7 @@ import java.util.regex.Pattern; @Fork(1) @Warmup(iterations = 2, time = 3, timeUnit = TimeUnit.SECONDS) @Measurement(iterations = 4, time = 3, timeUnit = TimeUnit.SECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) public class Primality { /** Number to be primality tested. */ @Param({"16", "17", /* "256", "257", */ "4096", "4099"}) diff --git a/test/micro/org/openjdk/bench/java/util/regex/Trim.java b/test/micro/org/openjdk/bench/java/util/regex/Trim.java index 4936f803db4..48d1cb91b66 100644 --- a/test/micro/org/openjdk/bench/java/util/regex/Trim.java +++ b/test/micro/org/openjdk/bench/java/util/regex/Trim.java @@ -78,7 +78,7 @@ import java.util.regex.Pattern; @Fork(2) @Warmup(iterations = 5, time = 3, timeUnit = TimeUnit.SECONDS) @Measurement(iterations = 5, time = 3, timeUnit = TimeUnit.SECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) public class Trim { /** Run length of non-matching consecutive whitespace chars. */ @Param({"16", "256", "4096"}) diff --git a/test/micro/org/openjdk/bench/javax/crypto/AESReinit.java b/test/micro/org/openjdk/bench/javax/crypto/AESReinit.java index 6a0fa892688..16f8b930633 100644 --- a/test/micro/org/openjdk/bench/javax/crypto/AESReinit.java +++ b/test/micro/org/openjdk/bench/javax/crypto/AESReinit.java @@ -35,7 +35,7 @@ import java.util.concurrent.TimeUnit; @Fork(value = 3, jvmArgsAppend = {"-Xms1g", "-Xmx1g"}) @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) public class AESReinit { private Cipher cipher; diff --git a/test/micro/org/openjdk/bench/jdk/incubator/vector/LoadMaskedIOOBEBenchmark.java b/test/micro/org/openjdk/bench/jdk/incubator/vector/LoadMaskedIOOBEBenchmark.java index 0bfd8a72e5a..869c98ef29f 100644 --- a/test/micro/org/openjdk/bench/jdk/incubator/vector/LoadMaskedIOOBEBenchmark.java +++ b/test/micro/org/openjdk/bench/jdk/incubator/vector/LoadMaskedIOOBEBenchmark.java @@ -29,7 +29,7 @@ import org.openjdk.jmh.annotations.*; @BenchmarkMode(Mode.Throughput) @OutputTimeUnit(TimeUnit.MILLISECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) @Warmup(iterations = 3, time = 1) @Measurement(iterations = 5, time = 1) @Fork(value = 1, jvmArgsPrepend = {"--add-modules=jdk.incubator.vector"}) diff --git a/test/micro/org/openjdk/bench/vm/compiler/Rotation.java b/test/micro/org/openjdk/bench/vm/compiler/Rotation.java index 979149ecb3b..a880f2c2309 100644 --- a/test/micro/org/openjdk/bench/vm/compiler/Rotation.java +++ b/test/micro/org/openjdk/bench/vm/compiler/Rotation.java @@ -41,7 +41,7 @@ import org.openjdk.jmh.infra.Blackhole; @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) @Fork(value = 3) @Measurement(iterations = 5, time = 1000, timeUnit = TimeUnit.MILLISECONDS) @Warmup(iterations = 5, time = 1000, timeUnit = TimeUnit.MILLISECONDS) diff --git a/test/micro/org/openjdk/bench/vm/compiler/x86/BasicRules.java b/test/micro/org/openjdk/bench/vm/compiler/x86/BasicRules.java index a7f7a363737..35a346d3ed8 100644 --- a/test/micro/org/openjdk/bench/vm/compiler/x86/BasicRules.java +++ b/test/micro/org/openjdk/bench/vm/compiler/x86/BasicRules.java @@ -28,7 +28,7 @@ import org.openjdk.jmh.infra.Blackhole; @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) @Fork(value = 3, jvmArgsAppend = "-XX:-UseSuperWord") @Warmup(time = 1, timeUnit = TimeUnit.SECONDS) @Measurement(time = 1, timeUnit = TimeUnit.SECONDS) diff --git a/test/micro/org/openjdk/bench/vm/compiler/x86/ConvertF2I.java b/test/micro/org/openjdk/bench/vm/compiler/x86/ConvertF2I.java index 61d375f4d82..406da5f65e5 100644 --- a/test/micro/org/openjdk/bench/vm/compiler/x86/ConvertF2I.java +++ b/test/micro/org/openjdk/bench/vm/compiler/x86/ConvertF2I.java @@ -28,16 +28,16 @@ import java.util.concurrent.TimeUnit; @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.NANOSECONDS) -@State(Scope.Benchmark) +@State(Scope.Thread) @Warmup(iterations = 5, time = 1) @Measurement(iterations = 5, time = 1) @Fork(value = 1, jvmArgsAppend = {"-XX:-UseSuperWord"}) public class ConvertF2I { static final int LENGTH = 1000; - static final int[] INT_ARRAY = new int[LENGTH]; - static final long[] LONG_ARRAY = new long[LENGTH]; - static final float[] FLOAT_ARRAY = new float[LENGTH]; - static final double[] DOUBLE_ARRAY = new double[LENGTH]; + int[] intArray = new int[LENGTH]; + long[] longArray = new long[LENGTH]; + float[] floatArray = new float[LENGTH]; + double[] doubleArray = new double[LENGTH]; float f; double d; @@ -64,28 +64,28 @@ public class ConvertF2I { @Benchmark public void f2iArray() { for (int i = 0; i < LENGTH; i++) { - INT_ARRAY[i] = (int)FLOAT_ARRAY[i]; + intArray[i] = (int)floatArray[i]; } } @Benchmark public void f2lArray() { for (int i = 0; i < LENGTH; i++) { - LONG_ARRAY[i] = (long)FLOAT_ARRAY[i]; + longArray[i] = (long)floatArray[i]; } } @Benchmark public void d2iArray() { for (int i = 0; i < LENGTH; i++) { - INT_ARRAY[i] = (int)DOUBLE_ARRAY[i]; + intArray[i] = (int)doubleArray[i]; } } @Benchmark public void d2lArray() { for (int i = 0; i < LENGTH; i++) { - LONG_ARRAY[i] = (long)DOUBLE_ARRAY[i]; + longArray[i] = (long)doubleArray[i]; } } }