I found out that wndproc
in BDS2006::VCL invalidates
CACHEs.
I have tried to override
wndproc
bywinapi
for
Application->Handle
is this easy but it does not stop the processing of messages forForm
. When I triedForm1->Handle
as window thenerror 1400
occurs (not valid window handle)I have tried to override
wndproc
by VCLfor Application by
TApplication events
and forForm
by override of virtualwndproc
member. Message processing stops but their calling sequences remains and the problem is not solved either.
So my conclusion after eliminating every possibility I can think off is that I need to flush CACHE more intensively somehow after setting process/thread for benchmarking.
In DOS I would done it by single instruction but on windows it is more tricky. Well The previous version of memory benchmark used just memory filling which is obviously not enough for BDS2006 exe. I think that instruction CACHE is involved in this problem not data cache so I change it a bit and it finally worked thing out.
Flushing the CPU CACHE:
for (DWORD i=0;i<(128<<20);i+=7)
{
dat[i]+=i;
dat[i]*=i;
dat[i]&=i;
}
Where dat is 128MB
allocated memory chunk (or bigger) and must be done after all process/thread priority and affinity changes or all winapi calls prior to benchmarking.