Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Profiling WPF application

Tags:

profiling

wpf

I have a WPF application, that is sometimes freezing for maybe a half minute and then works fine. I am thinking to profile that application. Anybody knows a good tutorial of how to profile WPF application? Or anybody has any idea on finding a way to know when it is freezing? The freezing is not consistent, and not related to any usage pattern

Thanks for help.

Ghassan

like image 478
Ghassan Karwchan Avatar asked Aug 06 '09 18:08

Ghassan Karwchan


People also ask

What is profiling in C#?

A profiler is a tool that monitors the execution of another application. A common language runtime (CLR) profiler is a dynamic link library (DLL) that consists of functions that receive messages from, and send messages to, the CLR by using the profiling API. The profiler DLL is loaded by the CLR at run time.

Which is a profiling tool?

You can use profiling tools to identify which portions of the program are executed most frequently or where most of the time is spent. Profiling tools are typically used after a basic tool, such as the vmstat or iostat commands, shows that a CPU bottleneck is causing a performance problem.

How to use vs Profiler?

Open the Performance Profiler by choosing Debug > Performance Profiler (or Alt + F2). For more information on using the CPU Usage or Memory usage tool in the Performance Profiler vs. the debugger-integrated tools, see Run profiling tools with or without the debugger.

How do I show diagnostic tools in Visual Studio?

When you start debugging in Visual Studio by selecting Debug > Start Debugging, or pressing F5, the Diagnostic Tools window appears by default. To open it manually, select Debug > Windows > Show Diagnostic Tools. The Diagnostic Tools window shows information about events, process memory, and CPU usage.


2 Answers

There is a toolset in the Windows SDK called WPFPerf - it has a set of tools (like Perforator) that help specifically with WPF debugging and profiling. Here's a quick guide on these tools.

For general .net profiling, RedGate Ants or JetBrains' dotTrace are great. There is also some profiling included in Visual Studio 2005/2008 (and better ones in 2010?).

like image 125
Philip Rieck Avatar answered Oct 21 '22 16:10

Philip Rieck


Profiling is overkill. During that half minute, it's waiting for something. Just pause it and see what it's waiting for.

like image 30
Mike Dunlavey Avatar answered Oct 21 '22 15:10

Mike Dunlavey