Profiling a XAML Windows Store App

- select the contributor at the end of the page -
SampleCount_thumb_3DB698BCIt's not always easy to know what's going on behind the scenes of a Windows Store App.  A recent blog post by Andrew B. Hall looks to shed some light into the dark corners of XAML apps where poor performance hides waiting for unsuspecting users.  In the post he covers everything from collecting data, CPU sampling, and analyzing profile reports.
"If you are developing a Windows Store App using XAML (whether it's C++, C#, or VB), there is a good chance there will be areas of your app where you would like to improve the performance. To assist with this, we've included the Visual Studio CPU profiler in all SKUs of Visual Studio capable of developing Windows Store Apps (this means we've moved the CPU profiler from being a Visual Studio Premium feature, to including it Visual Studio 2012 Professional and Visual Studio 2012 Express for Windows 8)." -- Andrew B. Hall's Blog

After showing some screen shots on how to get started sampling your application, Andrew explains the concepts of CPU sampling and how it works.
CPU sampling collects a call stack once every millisecond from the CPU (one call stack per core, so on a quad core machine for example there could be four stacks collected every millisecond).

Once profiling is stopped a report is built that is the summary of all the aggregated call stacks. The report will then show which methods were on the call stack most frequently (inclusive samples) and which methods were actually executing most frequently (exclusive samples) when the stacks were taken.

He then goes on to show examples of the analysis reports and key data items they contain.  In particular he covers the summary page, function details, and how to use the Call Tree View.
This will change to the call tree view of the profiler that shows me the complete distribution of the samples in my application. Looking at the call tree, I see that the only other call path that seems to have any significant number of samples in it is in nvwgf2um.dll which is ~40% of the CPU samples.

To learn more about Profiling a XAML Windows Store App, check out Andrew B. Hall's excellent blog post here.  You can also learn about debugging from the numerous courses in Pluralsight's library.

Get our content first. In your inbox.

Loading form...

If this message remains, it may be due to cookies being disabled or to an ad blocker.


Paul Ballard

is a Chief Architect specializing in large scale distributed system development and enterprise software processes. Paul has more than twenty years of development experience including being a former Microsoft MVP, a speaker at technical conferences such as Microsoft Tech-Ed and VSLive, and a published author. Prior to working on the Windows platform, he built software using a vast array of technologies including Java, Unix, C, and even OS/2.