How do I profile a specific method?

Code profiling for .NET Developers

Moderators: StephenC, Alex.Davies, AndrewH

How do I profile a specific method?

Postby rgelb » Fri Feb 05, 2010 6:47 pm

It does not even show up in the tree/list, but it is really important to me. Using 5.2.x
rgelb
 
Posts: 26
Joined: Thu Sep 25, 2008 12:36 am

Postby StephenC » Fri Feb 05, 2010 7:37 pm

Hi,

The first thing to make sure of is that you have the right profiling mode selected.

Secondly, if ANTS can't find the pdb files then the method(s) will be counted as methods without source code and therefore not show up with the default filter of 'only showing methods with source'. Make sure that all the files are in the correct place.

There is a checkbox with 'Hide Insignificant methods' which you can uncheck to show any methods that took less than 1% of time with children.

Finally, there are options in Tools > Options that allow you to adjust for inlining of functions, simplifying stack traces and ignoring trivial functions. You can adjust these but they may have a significant impact on the overhead of the profiler.

Stephen
StephenC
 
Posts: 306
Joined: Mon Oct 15, 2007 9:18 am
Location: Cambridge

Postby rgelb » Fri Feb 05, 2010 8:54 pm

Stephen,

Basically, I am profiling a WinForms app. The solution has a 5 projects in it (one EXE, the rest class libraries). I start the profiler from the ANTS 5 Toolbar in VS2008.

The method I am trying to profile is an CellChanged event on a 3rd party control. The event is in my code, I can step through it and I can plainly see that it's where the most damage is being done.

However, in the ANTS 5 profiler, I don't see this event method at all. The only thing I do see is a method that is kicked off by the function (on a separate thread though).

I did try playing around with the options you mentioned, all to no avail.
rgelb
 
Posts: 26
Joined: Thu Sep 25, 2008 12:36 am

Postby StephenC » Mon Feb 08, 2010 12:21 pm

Hi Frank,

which version of the Profiler do you have?

Is it the Standard edition or the Pro edition?

Stephen
StephenC
 
Posts: 306
Joined: Mon Oct 15, 2007 9:18 am
Location: Cambridge

Postby rgelb » Mon Feb 08, 2010 6:20 pm

Professional. Version 5.2.0.26
rgelb
 
Posts: 26
Joined: Thu Sep 25, 2008 12:36 am

Postby StephenC » Wed Feb 10, 2010 6:41 pm

Switching to CPU time instead of Wall Clock time resolved this issue.

This is a reasonably common issue with people switching to one timing and not switching back to the other when it's more suitable for examining the results.

Timing: controls the way in which method timings are calculated. You can choose from Wall-clock time which includes blocking such as waiting for I/O, or CPU time which excludes any time blocking.

You can read more about the results the profiler shows you depending on what you select here:

http://www.red-gate.com/supportcenter/Content.aspx?p=ANTS%20Performance%20Profiler&c=ANTS_Performance_Profiler/help/5.2/app_Working_with_the_call_tree.htm&toc=ANTS_Performance_Profiler/help/5.2/toc925914.htm

Regards,

Stephen
StephenC
 
Posts: 306
Joined: Mon Oct 15, 2007 9:18 am
Location: Cambridge


Return to ANTS Performance Profiler 5

Who is online

Users browsing this forum: No registered users and 1 guest