mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-09 09:16:34 +00:00
Fix cache wackiness
This commit is contained in:
@@ -10,9 +10,10 @@ public class NoiseTest {
|
||||
public void noise() {
|
||||
NoiseFunction2 noiseFunction = new NoiseFunction2(12345, new NoiseBuilder());
|
||||
System.out.println("Cache:");
|
||||
for(int i = 0; i < 10; i++) {
|
||||
int a = 0;
|
||||
for(int i = 0; i < 200; i++) {
|
||||
long l = System.nanoTime();
|
||||
for(int j = 0; j < 20000; j++) {
|
||||
for(int j = 0; j < 5000; j++) {
|
||||
for(int x = 0; x < 4; x++) {
|
||||
for(int y = 0; y < 64; y++) {
|
||||
for(int z = 0; z < 4; z++) {
|
||||
@@ -22,12 +23,13 @@ public class NoiseTest {
|
||||
}
|
||||
}
|
||||
double n = System.nanoTime() - l;
|
||||
System.out.println(n / 1000000 + "ms");
|
||||
System.out.print((long) n / 1000000 + "ms" + ((a % 10 == 0) ? "\n" : " "));
|
||||
a++;
|
||||
}
|
||||
System.out.println("No Cache:");
|
||||
for(int i = 0; i < 10; i++) {
|
||||
for(int i = 0; i < 200; i++) {
|
||||
long l = System.nanoTime();
|
||||
for(int j = 0; j < 20000; j++) {
|
||||
for(int j = 0; j < 5000; j++) {
|
||||
for(int x = 0; x < 4; x++) {
|
||||
for(int y = 0; y < 64; y++) {
|
||||
for(int z = 0; z < 4; z++) {
|
||||
@@ -37,7 +39,8 @@ public class NoiseTest {
|
||||
}
|
||||
}
|
||||
double n = System.nanoTime() - l;
|
||||
System.out.println(n / 1000000 + "ms");
|
||||
System.out.print((long) n / 1000000 + "ms" + ((a % 10 == 0) ? "\n" : " "));
|
||||
a++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user