add benchmark

This commit is contained in:
Shaojin Wen 2025-01-07 13:55:30 +08:00
parent dfaa89162a
commit 91db7c0877
2 changed files with 15 additions and 0 deletions

View File

@ -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) {

View File

@ -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) {