Damascus
Damascus

Reputation: 6651

Profiling WPF applications - rundown of all methods

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:

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!

Upvotes: 0

Views: 459

Answers (2)

Mike Dunlavey
Mike Dunlavey

Reputation: 40679

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.

Upvotes: 0

Murven
Murven

Reputation: 2387

You can use the Windows SDK WPF Performance Suite

Upvotes: 1

Related Questions