O
Oleg Kornilov
Hello !
Who can explain why readind from array[][] is fast, but
writing (same place) might take a lot of time (I need many loops)
How to solve it (declare as static or force some compiler (VC 6.0)
options) ??? Thanks in advance
Here is example (but critical !!!) code...
void main(int argc, char* argv[])
{
unsigned char r[360][180], dat2, i,j,k;
int p;
for (p=0; p<650; p++) {
for (i=0; i<200; i++) {
for (j=0; j<200; j++) {
for (k=0; k<100; k++) {
dat2=r[j]; dat2=r[j]; dat2=r[j];
// r[j]=dat2; r[j]=dat2; r[j]=dat2;
// critical point: without it almost no execution time
// with it - 6 seconds on P3-1000 ???
}
}
}
}
}
Who can explain why readind from array[][] is fast, but
writing (same place) might take a lot of time (I need many loops)
How to solve it (declare as static or force some compiler (VC 6.0)
options) ??? Thanks in advance
Here is example (but critical !!!) code...
void main(int argc, char* argv[])
{
unsigned char r[360][180], dat2, i,j,k;
int p;
for (p=0; p<650; p++) {
for (i=0; i<200; i++) {
for (j=0; j<200; j++) {
for (k=0; k<100; k++) {
dat2=r[j]; dat2=r[j]; dat2=r[j];
// r[j]=dat2; r[j]=dat2; r[j]=dat2;
// critical point: without it almost no execution time
// with it - 6 seconds on P3-1000 ???
}
}
}
}
}