mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-26 02:57:37 +01:00
Test bulk all operations
This commit is contained in:
parent
aac07c8ef1
commit
948073d291
@ -25,8 +25,8 @@ public class PaletteGetBenchmark {
|
||||
|
||||
int value = 0;
|
||||
final int dimension = palette.dimension();
|
||||
for (int y = 0; y < dimension; y++) {
|
||||
for (int x = 0; x < dimension; x++) {
|
||||
for (int x = 0; x < dimension; x++) {
|
||||
for (int y = 0; y < dimension; y++) {
|
||||
for (int z = 0; z < dimension; z++) {
|
||||
palette.set(x, y, z, value++);
|
||||
}
|
||||
@ -37,12 +37,17 @@ public class PaletteGetBenchmark {
|
||||
@Benchmark
|
||||
public void read(Blackhole blackHole) {
|
||||
final int dimension = palette.dimension();
|
||||
for (int y = 0; y < dimension; y++) {
|
||||
for (int x = 0; x < dimension; x++) {
|
||||
for (int x = 0; x < dimension; x++) {
|
||||
for (int y = 0; y < dimension; y++) {
|
||||
for (int z = 0; z < dimension; z++) {
|
||||
blackHole.consume(palette.get(x, y, z));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public void readAll(Blackhole blackHole) {
|
||||
palette.getAll((x, y, z, value) -> blackHole.consume(value));
|
||||
}
|
||||
}
|
||||
|
@ -27,8 +27,8 @@ public class PaletteSetBenchmark {
|
||||
public void incrWrite() {
|
||||
int value = 0;
|
||||
final int dimension = palette.dimension();
|
||||
for (int y = 0; y < dimension; y++) {
|
||||
for (int x = 0; x < dimension; x++) {
|
||||
for (int x = 0; x < dimension; x++) {
|
||||
for (int y = 0; y < dimension; y++) {
|
||||
for (int z = 0; z < dimension; z++) {
|
||||
palette.set(x, y, z, value++);
|
||||
}
|
||||
@ -37,10 +37,10 @@ public class PaletteSetBenchmark {
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public void randomWrite() {
|
||||
public void constantWrite() {
|
||||
final int dimension = palette.dimension();
|
||||
for (int y = 0; y < dimension; y++) {
|
||||
for (int x = 0; x < dimension; x++) {
|
||||
for (int x = 0; x < dimension; x++) {
|
||||
for (int y = 0; y < dimension; y++) {
|
||||
for (int z = 0; z < dimension; z++) {
|
||||
palette.set(x, y, z, 5);
|
||||
}
|
||||
@ -48,6 +48,11 @@ public class PaletteSetBenchmark {
|
||||
}
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public void constantWriteAll() {
|
||||
palette.setAll((x, y, z) -> 5);
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public void fill() {
|
||||
palette.fill(5);
|
||||
|
Loading…
Reference in New Issue
Block a user