diff --git a/test/micro/org/openjdk/bench/java/lang/Integers.java b/test/micro/org/openjdk/bench/java/lang/Integers.java index 9bf0be06d3d..404122cfbaa 100644 --- a/test/micro/org/openjdk/bench/java/lang/Integers.java +++ b/test/micro/org/openjdk/bench/java/lang/Integers.java @@ -44,7 +44,7 @@ import java.util.concurrent.TimeUnit; @BenchmarkMode(Mode.AverageTime) @OutputTimeUnit(TimeUnit.MICROSECONDS) @State(Scope.Thread) -@Warmup(iterations = 10, time = 500, timeUnit = TimeUnit.MILLISECONDS) +@Warmup(iterations = 5, time = 500, timeUnit = TimeUnit.MILLISECONDS) @Measurement(iterations = 5, time = 1000, timeUnit = TimeUnit.MILLISECONDS) @Fork(3) public class Integers { @@ -106,13 +106,6 @@ public class Integers { } } - @Benchmark - public void toHexString(Blackhole bh) { - for (int i : intsBig) { - bh.consume(Integer.toHexString(i)); - } - } - /** Performs toString on large values, roughly 10 digits. */ @Benchmark public void toStringBig(Blackhole bh) { @@ -121,6 +114,27 @@ public class Integers { } } + @Benchmark + public void toHexStringTiny(Blackhole bh) { + for (int i : intsTiny) { + bh.consume(Integer.toHexString(i)); + } + } + + @Benchmark + public void toHexStringSmall(Blackhole bh) { + for (int i : intsSmall) { + bh.consume(Integer.toHexString(i)); + } + } + + @Benchmark + public void toHexStringBig(Blackhole bh) { + for (int i : intsBig) { + bh.consume(Integer.toHexString(i)); + } + } + /** Performs expand on small values */ @Benchmark public void expand(Blackhole bh) { diff --git a/test/micro/org/openjdk/bench/java/lang/Longs.java b/test/micro/org/openjdk/bench/java/lang/Longs.java index 1e64b77ba90..dac6c1b4a40 100644 --- a/test/micro/org/openjdk/bench/java/lang/Longs.java +++ b/test/micro/org/openjdk/bench/java/lang/Longs.java @@ -87,17 +87,23 @@ public class Longs { /** Performs toString on large values, around 10 digits. */ @Benchmark - public void toHexString(Blackhole bh) { + public void toStringBig(Blackhole bh) { for (long value : longArrayBig) { + bh.consume(Long.toString(value)); + } + } + + @Benchmark + public void toHexStringSmall(Blackhole bh) { + for (long value : longArraySmall) { bh.consume(Long.toHexString(value)); } } - /** Performs toString on large values, around 10 digits. */ @Benchmark - public void toStringBig(Blackhole bh) { + public void toHexStringBig(Blackhole bh) { for (long value : longArrayBig) { - bh.consume(Long.toString(value)); + bh.consume(Long.toHexString(value)); } }