I have three questions about three nested loops:
for (int x=0; x<400; x++)
{
for (int y=0; y<300; y++)
{
for (int z=0; z<400; z++)
Have you tried this:
Object[][][] store = new Object[ 400 ][300][400];
for (int x=0; x<400; x++)
{
Object[][] matrix = store[x];
for (int y=0; y<300; y++)
{
Object[] line = matrix[y];
for (int z=0; z<400; z++)
{
// compute and store value
line[z] = // result;
}
}
}
it might improve your cache thrashing.