Fully featured low overhead profiler for Java EE and Java SE platforms.
Ultimate profiling and monitoring solution for Gradle, Maven, Ant, JUnit and TestNG.
Easy to use performance and memory profiler for .NET framework.

Difference between the methods CPU Times

Moderators: Vladimir Kondratyev, Anton Katilin

Difference between the methods CPU Times

Postby petrucio » Tue Mar 04, 2008 5:12 pm

Hi,

Could soumeone explain me why the methods CPU Times are allways different when succesive profilings are made for the same application on the same conditions?

I'm running on Windows Xp, and I tried both sampling and tracing profiling methods.

Thank you.
petrucio
 
Posts: 3
Joined: Tue Mar 04, 2008 5:00 pm

Postby Anton Katilin » Wed Mar 05, 2008 12:11 pm

Hello,

How big is the difference? Could you please provide the numbers.

Best regards,
Anton
Anton Katilin
 
Posts: 5575
Joined: Wed Aug 11, 2004 8:37 am

Postby petrucio » Wed Mar 05, 2008 1:39 pm

For exemple I'm obtaining (in the same conditions) for a method call:
1. 3710 ms
2. 3750 ms
3. 3650 ms
4. 3800 ms

You can see that I'm obtainig differences up to 3%.

Is this normal?
I was expecting CPU Times with differences between [-10 ms , +10 ms].
Thank you.
petrucio
 
Posts: 3
Joined: Tue Mar 04, 2008 5:00 pm

Postby Anton Katilin » Wed Mar 05, 2008 5:45 pm

I think 3% is normal, especially with sampling.

Any measuring provides results with stochastic inaccuracies.

What is the nature of profiled method call? Is it purely computational, or does it perform any I/O operations?
Anton Katilin
 
Posts: 5575
Joined: Wed Aug 11, 2004 8:37 am

Postby Anton Katilin » Wed Mar 05, 2008 5:47 pm

P.S.: I think if the method ran for a longer period of time (e.g. 10 seconds instead), the difference would be smaller.
Anton Katilin
 
Posts: 5575
Joined: Wed Aug 11, 2004 8:37 am

Postby petrucio » Wed Mar 05, 2008 10:23 pm

Are the methods purely computational?
In order to answer:
All I want to measure is the execution time of an iterative optimization algorithm under different optimization scenarios.
There are small differences between these scenarios.
So I need a quite accurate execution times measurments.
I can tell you that after each iteration there is a routine the writes same data into a buffer and when the algorithm stops the buffer is written into an output file.
Do you think that this may cause differences between the profiled times?
If this represents the problem...could you suggest me how to use the profiler?
If I ignored these methods for being profiled could I obtain more accurate results?
Thank you!
petrucio
 
Posts: 3
Joined: Tue Mar 04, 2008 5:00 pm

Postby Anton Katilin » Thu Mar 06, 2008 10:44 am

File output can be one of reasons of execution time fluctuations.

If need most accurate results, you can:

1. Artificially increase number of repetitions of your algorithm for purposes of profiling. E.g. wrap it with a 'for' cycle. The bigger execution time, the smaller share of stochastic fluctuations.

2. For a more precise measuring, use tracing. Although it may be requires to tune filter set to receive most adequate results.
Anton Katilin
 
Posts: 5575
Joined: Wed Aug 11, 2004 8:37 am


Return to .NET Profiler

Who is online

Users browsing this forum: No registered users and 1 guest