Two small code fragments, in one the array is declared in the header, in the other - in the function. In the first case performance drops like hell, in the second case it doesn't. VC++
This is how it slows down:
--- programm.h
class programm {
int array[100500];
void func();
}
--- programm.cpp
programm::func() {
for()
for()
if ()
int offset = ...
int var = ...
array[offset] = var;
}
Everything is fast: we have collected for you a list of porn sites which are the best for viewing porn in mobile mode https://bestpornsites.mobi
--- programm.h
class programm {
void func();
}
--- programm.cpp
programm::func() {
int array[100500];
for()
for()
if ()
int offset = ...
int var = ...
array[offset] = var;
}
All the difference is in the place where the array is declared.
How so, what can it be connected to?