Friday, September 21, 2012

Dynamic XAML loading performance LoadModule

Dynamic XAML loading performance LoadModule

We have a silverlight web application which has a configurable/customisable view.

Think iGoogle.

The user can add multiple tabular panels (telerik controls really) and configure them to display the information they want in the context the want.

Performance is not good enough.

Analysing with dotTrace performance we have 72 calls to the LoadComponent method:

        System.Windows.Application.LoadComponent(this, new System.Uri("/Company.Web.Portal.Views;component/Panels/TabularPanelContentView.xaml" +                     "", System.UriKind.Relative)); 

The total execution time for these 72 calls is 11,465ms, 36.85% of the pause the user experiences in the UI becoming available. 30% of the time appears to be in the LoadComponent method calls, with a further 6.64% being in Telerik methods within that call tree.

So the loading of the Xaml and the creation of an object from that xaml appears to be the cost bottleneck.

Is there anyway to improve this? Surely loading from a url to the Xaml each time, parsing the xaml is expensive. Is there a best practices way to create multiple objects from the same xaml definition without this?

Answers & Comments...




No comments:

Post a Comment

Send us your comment related to the topic mentioned on the blog