Welcome to MSDN Blogs Sign in | Join | Help

Pinpoint a performance issue using hotpath in Visual Studio 2008

Analyzing a performance report

 

                When you first open a performance report in Visual Studio 90% of the time the question on your mind is “where is my program spending most of its time?” In Visual Studio 2005 the best way to find this was to move to the calltree view and from there to follow the execution path with high inclusive functions down the tree. If you are not familiar with the calltree view, this view places all the execution paths of your program into one big tree structure. In this tree you can see both inclusive and exclusive values for either samples (in sampling mode) or time (in instrumentation mode). In a nutshell, inclusive means “functions that caused work” so any inclusive time or samples for a function can be attributed to that function or any of its sub-functions. On the other hand, exclusive values can be attributed only to that function and do not include any values from sub-functions.

                So with the above explanation the way to find out where your program is spending most of its time is to drill down the tree and whenever you have a choice between children of a function pick the child with the highest inclusive value (meaning that it is doing more work below it then the other children). Eventually you will reach some functions with high exclusive values, which are the functions that are actually doing the most work in your program. At that point you can examine those functions and the path taken to them and start working to fix your performance issue.

 

Hotpath

 

                The problem with the above scenario is that, quite frankly, it’s a pain in the butt to have to always drill down on the tree to find these hot functions and hot paths. Especially with sampling reports the calltree can be many levels deep and it can take a while to get to the functions of interest. So for Visual Studio 2008 we’ve added a small, but very useful feature called “Hotpath” to automate this scenario. Now when you open a performance report and move to the calltree view you will see a small flame icon located in the toolbar. When you push this button it will expand the hot path from the root following the rules that we mentioned above (following the high inclusive numbers when choosing between children). In the example seen below I’ve run a profiling session on a managed application that calculates and displays a Mandelbrot set. When running Hotpath on the report it jumps me down the tree directly to the DrawMandel and SetPixel functions that are performing the bulk of the work for this scenario. The Hotpath will stop whenever it reaches a function with high exclusive values or when it hits two children with similar inclusive values. Also, it can be run from any point in the tree (just right click on the function) so you don’t have to always run it from the root function.

hotpath               

                As you can see, the hotpath feature can save you a lot of time in performance analysis. Already folks who use the profiler internally here at Microsoft have become big fans of this feature. In fact, there has been spontaneous applause at meetings when we demoed the feature for the first time! As of right now it’s the closest that we have to a “show me my performance issue button.” And it’s one of the many ways that we are trying to help users to better understand and take action on their performance information in Visual Studio 2008.

 

Published Friday, September 14, 2007 10:34 AM by ianhu

Comments

# re: Pinpoint a performance issue using hotpath in Visual Studio 2008

Very cool!! As an addendum to this technology, would it be possible to exclude paths that delve into CLR classes.

For example, if I'm building a windows form and I want to know why a certain tab is taking so long to load. I'm not interested in CLR classes; only the ones i have created (also not interested in the methods that my class might call that go into the CLR).

Thanks.

Friday, September 14, 2007 3:14 PM by Sushant Bhatia

# Debugging and Profiling Features in VS 2008

I wanted to do a little tour of some debugging and profiling features that you will see in Visual Studio

Friday, September 14, 2007 10:08 PM by Somasegar's WebLog

# Debugging and Profiling Features in VS 2008

I wanted to do a little tour of some debugging and profiling features that you will see in Visual Studio

Friday, September 14, 2007 11:09 PM by Noticias externas

# VS2008中调试与分析的新特性

[ 原文地址 ] Debugging and Profiling Features in VS 2008 [ 原文 发表时间 ] Friday, September 14, 2007 6:48 PM 我希望介绍一些在

Monday, September 17, 2007 9:15 AM by Joycode@Ab110.com

# re: Pinpoint a performance issue using hotpath in Visual Studio 2008

Sushant,

That is not currently a feature of hot path. But we are currently working on two features to either hide or factor out framework or glue code when viewing profing results.

~Ian

Monday, September 17, 2007 12:15 PM by ianhu

# Izindaba #10

A bit earlier than normal, but it is time for another weekly roundup of news that focuses on .NET, agile

Thursday, September 20, 2007 9:22 AM by From the software development trenches

# Using VSTS 2008 memory allocation profiling

I wanted to learn about the memory allocation profiling feature that is available VSTS 2008. While the

Tuesday, October 09, 2007 6:44 PM by Buck Hodges

# Articles on new Visual Studio Team System 2008 profiler features

I’ve recently been working on a series of post on my blog about many of the cool new features that we

Friday, October 19, 2007 1:11 PM by Enterprise Performance Tools Team

# Visual Studio Team System 2008 ships!

What else can I say? The big day has arrived (read the official word here on Soma's blog ) and we're

Monday, November 19, 2007 12:19 PM by Jeff Beehler's Blog

# Getting .NET Framework 3.5 and VS2008 Adopted

I'm currently trying to pro-actively drive the adoption of the .NET Framework 3.5 and VS 2008 within

Monday, November 26, 2007 8:17 AM by From the software development trenches

# Need to Load test WCF Applications?

Rob Jarratt (fellow UK Microsoftie) has just released a tool that will take a WCF trace and generate

Saturday, January 26, 2008 10:15 AM by Microsoft UK Developer Tools Team

# Need to Load test WCF Applications?

Rob Jarratt (fellow UK Microsoftie) has just released a tool that will take a WCF trace and generate

Saturday, January 26, 2008 10:34 AM by Noticias externas

# Novedades en Visual Studio Team System 2008

Como muchos ya sabréis hace poco Microsoft lanzó al mercado Visual Studio 2008. Si estáis interesados

Sunday, March 09, 2008 5:45 PM by Yo sólo pasaba por aquí pero ya que estoy....

# Where are the most bytes for a type being allocated?

In Visual Studio 2008, we added the ability to quickly determine the most expensive call stack in your

Saturday, June 14, 2008 7:26 PM by Visual Studio Profiler Team Blog

# Visual Studio Team System 2008 Development Edition with MSDN Premium Subscription

[ Nacsa Sándor , 2009. január 19. – február 5.] Ez a Team System változat fejlett eszközrendszert kínál

Thursday, February 05, 2009 12:50 PM by Termékinformációk fejlesztőknek
New Comments to this post are disabled
 
Page view tracker