0

I am having trouble profiling my WPF application.

Here is the situation: any use-case will be the following: enter values -> click on "compute values" -> loading... -> display values.

During the "Loading..." phase, there are two phases:

  • A pure mathematical phase, which is extremely optimized
  • A "WPF is drawing your controls" phase, which is... well... long.

What I want to do here is to profile the application to have a TreeView with: function, elapsed time, number of calls. I usually use the Visual Studio profiler (mostly because my company doesn't wanna pay for a good profiler. Ask people to optimize performance, don't give them any good profiler, let's just politely say it's a nice company policy). The problem is that this profiler does not go until WPF system functions (draw, MeasureOverride, measureLength....).

I used JetBrains' dotTrace for a while (the 10 day trial... meh) whic is truely awesome, since it was able to really separate the phases even in the most precise situations (time elapsed to color one cell in a datagrid, time elapsed to calculate one cell's width...). Ants doesn't seem like it profiles WPF (it just displays "Managed code" ... )

So right now, my Visual Studio profiler stops at a function which defines an Xaxis for a Visiblox chart. It just tells me that WPF takes around 2.3 seconds to "Define XAxis", while 2.3 seconds is actually the entire time spent to draw all my grids&graphs

Do you guys know by any chance a profiler (or a setting in VS profiler) which can do the magic?

Thanks a lot!

Damascus
  • 6,553
  • 5
  • 39
  • 53

2 Answers2

1

You can use the Windows SDK WPF Performance Suite

Murven
  • 2,377
  • 17
  • 23
  • Already did, and unless I didn't really understand how to use it, I didn't find any detailed call list. But this helped me a lot to figure out what should I improve in my UI! – Damascus Nov 03 '11 at 08:07
0

Stuck record here. You think you want a tree view, with elapsed time, call count, etc., but what you need is to optimize the app by finding what you can fix to eliminate wall-clock time being spent unnecessarily. Here's an example of what works best, in my experience.

It is very easy for something to be taking a large fraction of time, where it is not necessarily localized to particular routines, particular lines of code, or particular paths in the call tree. That method finds it no matter where it is. What more, it doesn't bother measuring the problem beyond the minimum needed to find it. However, if you really feel the need to buy or install something, it doesn't help you there.

Community
  • 1
  • 1
Mike Dunlavey
  • 40,059
  • 14
  • 91
  • 135