mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
Merge
This commit is contained in:
commit
3ad3950560
11 changed files with 240 additions and 10 deletions
|
@ -57,6 +57,7 @@ public class Integers {
|
|||
private int[] intsTiny;
|
||||
private int[] intsSmall;
|
||||
private int[] intsBig;
|
||||
private int[] res;
|
||||
|
||||
@Setup
|
||||
public void setup() {
|
||||
|
@ -66,6 +67,7 @@ public class Integers {
|
|||
intsTiny = new int[size];
|
||||
intsSmall = new int[size];
|
||||
intsBig = new int[size];
|
||||
res = new int[size];
|
||||
for (int i = 0; i < size; i++) {
|
||||
strings[i] = "" + (r.nextInt(10000) - (5000));
|
||||
intsTiny[i] = r.nextInt(99);
|
||||
|
@ -164,4 +166,11 @@ public class Integers {
|
|||
bh.consume(r);
|
||||
}
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public void reverseBytes() {
|
||||
for (int i = 0; i < size; i++) {
|
||||
res[i] = Integer.reverseBytes(intsSmall[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue