Re: Can extra processing threads help in this case?
"Pete Delgado" <Peter.Delgado@NoSpam.com> wrote in message
news:ei$3u1FzKHA.2644@TK2MSFTNGP04.phx.gbl...
"Peter Olcott" <NoSpam@OCR4Screen.com> wrote in message
news:SOqdnbRxhpnk4DbWnZ2dnUVZ_radnZ2d@giganews.com...
I was making a conservative estimate, actual measurement
indicated zero page faults after all data was loaded,
even after waiting 12 hours.
Are you:
a) Running under the debugger by any chance?
b) Allowing the system to hibernate during your 12 hour
run?
c) Doing anything special to lock the data in memory?
No, No, No
I would expect that the SuperFetch service as well as the
working set manager to work against keeping your large
data file in memory if you are simply using the standard
malloc or new to reserve space for your data within your
program. In fact, I built a test system with Windows 7 x64
and 8GB of memory and Quad processor to test your
assertion, but I noticed immedietly that even with the
amount of memory installed on my system and NO additional
programs beyond the OS, I still have a non-zero pagefault
delta when I simply switch between applications. While
that certainly is not an exhaustive test, it indicates the
type of behavior that I expected.
If you would like to supply me with your test exectuable
and data file, I'd be happy to test on my system to see if
I get the same results as you do as I do not mind
reimaging the machine.
-Pete
I have posted the source code many times, it creates its own
data.
This test program has essentially the same characteristics
as my OCR system.
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <time.h>
//#define uint32 unsigned int
typedef unsigned int uint32;
const uint32 size = 100000000;
std::vector<uint32> Data;
uint32 Max = 0x3fffffff;
double Process() {
long long Sum = 0;
clock_t finish;
clock_t start = clock();
double duration;
uint32 num = 0;
for (uint32 N = 0; N < Max; N++)
num = Data[num];
finish = clock();
duration = (double)(finish - start) / CLOCKS_PER_SEC;
return duration;
}
void Initialize() {
Data.resize(size);
for (uint32 N = 0; N < size; N++) {
uint32 Random = rand() * rand();
Random %= size;
Data[N] = Random;
}
char N;
printf("Hit any key to Continue:");
scanf("%c", &N);
}
int main() {
double duration;
double MBperSec;
printf("Size in bytes--->%d\n", size * 4);
Initialize();
duration = Process();
MBperSec = (double)(Max * 4) / (duration * 1024 * 1024);
printf("%4.2f Seconds %4.2f Megabytes Per Second\n",
duration, MBperSec);
return 0;
}