|Is "Cumulative CPU time" supposed to be the same from run to run? [message #120974]
||Wed, 16 January 2008 21:57
Originally posted by: dinogg.gmail.com|
I'm a newbie at tptp (126.96.36.199 all in one) and couldn't find any info on
this in the docs or newsgroup. So here I go...
When I profile my Swing-based Java application, I can choose to "Collect
method CPU time information". When I do that, I get a new column called
"Cumulative CPU Time" for each of the methods called.
Based on my limited experience with CPU time and JVMs, I would expect the
CPU time to be the same for a given method from run to run.
But I get a different values for the same method each time I run it.
Have I misunderstood the meaning of CPU time?
The next thing I'm going to try is remove Swing from the picture and
create a simple Java app instead.
|Re: Is "Cumulative CPU time" supposed to be the same from run to run? [message #121061 is a reply to message #120974]
||Sun, 20 January 2008 09:22
| Asaf Yaffe
Registered: July 2009
The TPTP Profiler provides two "time" counters:
- "Execution Time" - always provided - shows the total "wall clock" time
it took the method to execute. This is computed by capturing the system
timer at the beginning and end of the method, and subtracting the "start
time" from the "end time".
- "CPU Time" - configurable - shows the actual time the method was
executing in the CPU. It should provide an estimate for the actual CPU
cycles used to execute this CPU, not counting idle time, context
switches etc. This value is captured from the JVM directly, using some
JVMTI functions (see GetThreadCPUTime function here:
The problem with CPU Time is that the data provided by the JVM is not
very accurate and is not granular enough. In fact, on most current JVMs,
any method which keeps the CPU busy for less than a millisecond (which
is quite a lot of CPU time on a modern CPU) will be reported with a CPU
time of 0. Therefore, I think this counter is not very usable.
Eclipse TPTP Committer, JVMTI Profiler
Powered by FUDForum
. Page generated in 0.03863 seconds