Benchmarking affected by VCL

故事扮演 提交于 2019-11-29 15:37:49

I found out that wndproc in BDS2006::VCL invalidates CACHEs.

  1. I have tried to override wndproc by winapi

    for Application->Handle is this easy but it does not stop the processing of messages for Form. When I tried Form1->Handle as window then error 1400 occurs (not valid window handle)

  2. I have tried to override wndproc by VCL

    for Application by TApplication events and for Form by override of virtual wndproc 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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!