11

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

Ghassan Karwchan
  • 3,355
  • 7
  • 37
  • 65

2 Answers2

10

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?).

Philip Rieck
  • 32,368
  • 11
  • 87
  • 99
  • According to this link (http://msdn.microsoft.com/en-us/library/ms182372%28v=vs.100%29.aspx), VS2010 Performance Profiler is not available in all editions. – kevinarpe Nov 01 '12 at 02:08
  • @PhilipRieck: What is the current alternative for WPF Performance Suite for profiling .NET 4.5 apps? I would very appreciate you if you take a look at my question [here](http://stackoverflow.com/q/33468572/3345644). – Alexander Abakumov Nov 02 '15 at 18:27
2

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

Community
  • 1
  • 1
Mike Dunlavey
  • 40,059
  • 14
  • 91
  • 135
  • While I agree that this is a good technique to use in general, I disagree that it is always caused by an infinite loop. There could be blocking going on by some API waiting for a resource. There's a lot of reasons your UI could freeze that are not related to an infinite loop. I only say this just to make sure no one goes on a wild goose chase. – Anderson Imes Aug 10 '09 at 03:41
  • @Anderson: OK, I re-worded it to take out the "nearly infinite loop" part. The principle is the same. During that half minute, it's in a state in which it is waiting for something, after which it will resume useful work. Just pause it, and you'll see what it's waiting for, whether it's a low-level loop, getting a resource, whatever. People think this is hard, and it's not. – Mike Dunlavey Aug 10 '09 at 12:11