RadDiagram and *AutomationPeer and Serialize and performance

1 Answer 170 Views
Diagram
David
Top achievements
Rank 1
Iron
Iron
David asked on 05 Nov 2021, 11:28 PM

We have some performance problems with a large RadDiagram (in one case, there are 372 shapes and 1200+ links, for instance).

While doing some performance profiling, I notice that a great deal of time is spent in RadDiagramConnectionAutomationPeer.GetItemStatusCore and RadDiagramShapeAutomationPeer.GetItemStatusCore.  Both of these are calling an AutomationXmlSerializer.Serialize method that takes a the vast majority of the time.  This is going on when the diagram is just sitting there with no interaction going on, no changes happening, etc. -- just displaying.

I don't think we've done anything to serialize the diagram intentionally.  For instance, I see there is a RadDiagram.Save() method; we are not calling that anywhere, and I can't find it in any of the call history.  I also don't see any of our calls leading to these GetItemStatusCore calls, so I'm thinking it's being triggered implicitly somehow.

What are we doing that's triggering this serialization?  Is it a critical part of the function of RadDiagram?  Since it's causing performance problems, is there anything we can do about it, please? 

I also don't (think I) see any documentation for these classes or methods online (or, internet searches turn up nothing for them), so I'm not sure how to proceed on my own.

This is with v. 2021.1.325.40.

Thanks!

-David Marshburn

1 Answer, 1 is accepted

Sort by
0
David
Top achievements
Rank 1
Iron
Iron
answered on 06 Nov 2021, 12:01 AM

Looking further into my profiling, I'm seeing that all these methods are called by
  System.Windows.Automation.peers.AutomationPeer.UpdateSubtree

This seems to be the following feature
  https://docs.microsoft.com/en-us/dotnet/framework/ui-automation/ui-automation-overview

I see it being discussed here:
  https://docs.telerik.com/devtools/wpf/common-information/common-ui-automation

If I set the following in the application, it seems to fix the performance problems (or the sluggishness when viewing the diagram)
  AutomationManager.AutomationMode = AutomationMode.Disabled

Are there any ramifications I should be aware of when doing so? 

 

Dilyan Traykov
Telerik team
commented on 10 Nov 2021, 03:14 PM

Hello David,
A similar scenario has been discussed in this forum thread: AutomationMode. It also explains the consequences of disabling the creation of automation peers.
Please have a look and let me know if it answers your questions.

David
Top achievements
Rank 1
Iron
Iron
commented on 10 Nov 2021, 05:12 PM

Yes, thank you.

I think I could advise that a review of the performance of your automation peers might be in order.  They were crushing performance, and while nothing was going on.  It feels like they're fully rebuilding their text representation on a timer; it might be better to cache unless/until something changes.

Dilyan Traykov
Telerik team
commented on 12 Nov 2021, 03:41 PM

Using the default Advanced AutomationMode can result in overhead in some controls, especially when there is a big number of elements on screen as in your particular case. However, it is not straightforward to apply caching, and these calls are actually required.

You do not, however, require this mode unless you're writing CodedUI tests which require support for levels 2,3, and 4. As mentioned in the referenced article, most Coded UI Test features could be used just by implementing Level 1.

With this said, you can still benefit from the accessibility and basic CodedUI support by setting the AutomationMode to Basic.

I hope you find this information helpful.
Tags
Diagram
Asked by
David
Top achievements
Rank 1
Iron
Iron
Answers by
David
Top achievements
Rank 1
Iron
Iron
Share this question
or