| Author |
Message |
Patrick
Joined: 12 Oct 2009 Posts: 5
|
Posted: Mon Oct 12, 2009 2:29 am Post subject: WPF OnPropertyChanged ... what is slow?? |
|
|
Hi,
I am trying to figure out how to profile a WPF application. I see that the slow down seems to be the OnPropertyChanged event and therefore I suspect that it is some data binding that is slow.
My question is how can I get to the details? Which listener is slowest? The methods mentioned in the Method list stops at the OnPropertyChanged method?
Any tips or pointers?
cheers,
Patrick |
|
| Back to top |
|
 |
Chris.Allen
Joined: 12 Mar 2009 Posts: 443
|
Posted: Tue Oct 13, 2009 2:45 pm Post subject: |
|
|
What happens when you create a "call graph" centered on theOnPropertyChanged method and the right-click and expand the call stack down? Does it show you further called methods?
(The call graph view can be selected by clicking on the small blue/green/yellow icon that appears to the right of each method when clicked on). |
|
| Back to top |
|
 |
Patrick
Joined: 12 Oct 2009 Posts: 5
|
Posted: Wed Oct 14, 2009 12:49 am Post subject: |
|
|
OnPropertyChanged
-> PropertyChangedEventManager.OnPropertyChanged
-> WeakEventManager.DeliverEventToList
-> PropertyPathWorker.ReceiveWeakEvent
-> ClrBindingWorker.OnSourcePropertyChanged
-> OnPropertyChangedAtLevel
-> PropertyPathWorker.UpdateSourceValueState
-> PropertyPathWorker.UpdateSourceValueState
-> ClrBindingWorker.NewValueAvailable
-> BindingExpression.TransferValue
-> BindingExpression.Invalidate
-> DependencyObject.InvalidateProperty
-> DependencyObject.UpdateEffectiveValue
-> (Simplified stack traces - ANTS Performance PRofiler has simplified child stack traces to reduce memory usage)
-> last message repeats (lots of times)....
Apparently it is some sort of binding but I have lots of bindings and it would be good to know which ones are taking the longest to update the value? |
|
| Back to top |
|
 |
StephenC
Joined: 15 Oct 2007 Posts: 314 Location: Cambridge
|
Posted: Thu Oct 15, 2009 1:18 pm Post subject: |
|
|
Hi Patrick,
i'm assuming from your description that you haven't created the Call Graph that Chris was referring to.
If you select the OnPropertyChanged method from the TreeView you will notice an icon appears in the selected row. If you create a call graph by clicking on that graph the view may reveal something a little more informative about the issue.
The other point you raised about the simplified stack trace in the TreeView is a measure that we implemented to help reduce the impact of profiling on the performance of the application. This option can be turned off so that you see more methods (although the stack trace could be huge as a result) by going to Tools > Options prior to starting profiling and unchecking the "Simplify very complex stack traces to save memory" option. This may have a negative impact on profiling performance.
Regards,
Stephen |
|
| Back to top |
|
 |
Patrick
Joined: 12 Oct 2009 Posts: 5
|
Posted: Fri Oct 16, 2009 12:29 am Post subject: |
|
|
| I did create the callgraph and this was the hierarchy I could see in the callgraph... will try unchecking the simplified stack trace option. |
|
| Back to top |
|
 |
|
|
All times are GMT + 1 Hour
|
| Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group