mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-23 05:10:57 +00:00
add benchmark
This commit is contained in:
parent
dfaa89162a
commit
91db7c0877
@ -106,6 +106,13 @@ 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) {
|
||||
|
||||
@ -85,6 +85,14 @@ public class Longs {
|
||||
}
|
||||
}
|
||||
|
||||
/** Performs toString on large values, around 10 digits. */
|
||||
@Benchmark
|
||||
public void toHexString(Blackhole bh) {
|
||||
for (long value : longArrayBig) {
|
||||
bh.consume(Long.toHexString(value));
|
||||
}
|
||||
}
|
||||
|
||||
/** Performs toString on large values, around 10 digits. */
|
||||
@Benchmark
|
||||
public void toStringBig(Blackhole bh) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user