Re: Help! Problem on CPU usage and performance tuning.
From: Jochen Kalmbach (nospam-Jochen.Kalmbach_at_holzma.de)
Date: 10/20/04
- Next message: Olof Lagerkvist: "Re: Is it possible to get the filename from a file handle?"
- Previous message: youhua.wang: "Re: Help! Problem on CPU usage and performance tuning."
- In reply to: youhua.wang: "Re: Help! Problem on CPU usage and performance tuning."
- Next in thread: Jochen Kalmbach: "Re: Help! Problem on CPU usage and performance tuning."
- Reply: Jochen Kalmbach: "Re: Help! Problem on CPU usage and performance tuning."
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 20 Oct 2004 04:26:47 -0700
Hi youhua.wang,
> But i think you make a mistake.
> Actually i use value return by GetThreadTimes for profile. while use
> GetTickCount() function just as comparison with GetThreadTimes().
Internally the Kernel- and UserTime is incremented by the timer-
resolution of the hal. This resolution is stored in "nt!
KeMaximumIncrement"
On my system this value is 25178 (100ns) => 2517,8 uS => 2,5 ms
So you see that the resolution is better than with "GetTickCount" but it
is worsen than using "QueryPerformanceCounter".
> Isn't QueryPerformanceCounter() return CPU time of all thread , inlude
> thread context switch?
It has the same effect as if you would use "GetTickCount" but it has a
far better resolution (on single CPU system it uses the rtdsc assembler
code, which has the same resolution as the CPU-speed.
> It can not give out the exactly CPU time of per thread. But longer
> test time is a way.
As you see, GetThreadTimes is also very diffuse for short times... and if
your thread often does not use the full quantum, then it might also be
diffus.
So it is always better to do a longer testrun.
-- Greetings Jochen My blog about Win32 and .NET http://blog.kalmbachnet.de/
- Next message: Olof Lagerkvist: "Re: Is it possible to get the filename from a file handle?"
- Previous message: youhua.wang: "Re: Help! Problem on CPU usage and performance tuning."
- In reply to: youhua.wang: "Re: Help! Problem on CPU usage and performance tuning."
- Next in thread: Jochen Kalmbach: "Re: Help! Problem on CPU usage and performance tuning."
- Reply: Jochen Kalmbach: "Re: Help! Problem on CPU usage and performance tuning."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|