In these loops, I use alot of new variables like so
for (int i = 0; i > 500; i++)
{
for (int j = 0; j > 500; j++)
{
int foo = 0;
int bar = 2;
double a;
double b;
double c;
double x;
double y;
double z;
// Do Something
}
}
that means to me, that I allocate new memory everytime I run trough the loop.
When done something like this:
int foo = 0;
int bar = 2;
double a;
double b;
double c;
double x;
double y;
double z;
for (int i = 0; i > 500; i++)
{
for (int j = 0; j > 500; j++)
{
// Do Something
}
}
isn't that pretty much faster?
Because I use the same memory for every loop, instead of allocate evertime new one?
Edited by Imprecision, 29 April 2012 - 09:10 AM.







