Line-level timings problem?

Code profiling for .NET developers.

Moderators: AndrewH, melvyn.harbour, james.billings, Laura Morley, dene.boulton

Line-level timings problem?

Postby aprilia_racing » Wed Aug 01, 2012 8:32 am

Hi everyone,
I started using the performance profiler a couple of months ago, thus I'm probably not so skilled in it.

I'm profiling a part of my .Net 4 application, precisely the one that has to make a lot of math computation. To simplify, suppose we a have a "for" statement looping a lot (about 500 thousands) of times. Within the statement there's the code the makes the actual computation on some signals samples.

The problem is that each time I profile my code (using always the same set of input data) I have different timing information, even the one that refers to the "for" first row (I mean: for (int i = 0; ... ) ).
Since I'm using "Line-level and method-level timings; all methods" profiling mode, I thought the timing values were "pure" execution times (I mean, they don't depend on what else my pc is running).

I'm using ANTS Performance Profiler 7.3 Professional.

Thanks a lot for,
have a nice day
Marco Stevanato

Software Engineer
Aprilia Racing S.r.l.
aprilia_racing
 
Posts: 2
Joined: Wed Aug 01, 2012 8:05 am

Postby james.billings » Thu Aug 02, 2012 12:44 pm

Thanks for your post.

The line-level timing is actually the most *detailed* but not the most *accurate*. The profiler tries to adjust timings to counteract the effect profiling has on the performance of the application and this is actually less reliable on line-level timing. This could easily mean you get slightly different results each time you run.

We explain the various modes on this page and you'll see that method level (only with source) is the most 'accurate'
james.billings
 
Posts: 1144
Joined: Wed Jun 16, 2010 11:10 am
Location: My desk.

Ok

Postby aprilia_racing » Mon Aug 20, 2012 8:52 am

Thanks a lot for your answer, I'll take a look at the link you gave me.

Have a nice day
Marco Stevanato

Software Engineer
Aprilia Racing S.r.l.
aprilia_racing
 
Posts: 2
Joined: Wed Aug 01, 2012 8:05 am


Return to ANTS Performance Profiler 7

Who is online

Users browsing this forum: No registered users and 1 guest