简体   繁体   中英

WPF application performance

How to profile a WPF application? I am a beginner C# developer, so I'm sure I would have made some mistakes/bad practices which I should alteast catch by profiling.

Is there a way I can see stack call of all the methods(only ones coded by me, not .NET library functions) and the duration of execution of each method?

Visual Studio includes a great profiling tool:

http://msdn.microsoft.com/en-us/library/z9z62c29.aspx

Another popular profiler for .NET is RedGate ANTS:

http://www.red-gate.com/products/dotnet-development/ants-performance-profiler/

I've found RedGate ANTS easier to setup and use, but in the long run, I had better results with Visual Studio's profiler.

You can see time spent in just your methods, time spent in all methods, CPU time vs Wall time, and other useful metrics.

Just glancing around, this looks like a pretty good tutorial on the profiling tools of Visual Studio: http://www.geekzone.co.nz/vs2008/6265

It's for Visual Studio 2008, but it's the same concepts if you are using VS2010.

Beyond that, your probably need to ask something more specific.

As part of the SDK for Win7 .NET4 there is a profiler tool "The WPF Performance Suite enables you to analyze the run-time behavior of your WPF applications and determine performance optimizations that you can apply. The WPF Performance Suite includes performance profiling tools called Perforator and Visual Profiler"

http://msdn.microsoft.com/en-us/library/aa969767.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM