Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
280
huge performance difference between xmldataprovider and custom objects
posted

In a test project, I have ~700 rows and 20 columns in xamdatagrid, I have set EditAsType but not much more.

This is however dog slow both in loading asynchronously (I'm using XmlDataProvider.DeferRequest() while updating) but also when scrolling around in the grid, and while doing so it maxes out the cpu. To some degree I can understand why loading is slow due to nodechanged events and such, but why is scrolling around slow?

I created a second project, with the same data, same async loading, but now the grid is bound to an observablecollection<ResultsResult> where ResultsResult is created by xsd.exe from the same xml schema.

Now the second project loads quickly, is responsive when scrolling, i.e. is usable.

Why is there such a difference between the two projects? I'd like to use the xml approach performance allowing as I expect schema changes after app has been deployed.

  • 9694
    posted

    Hi,

    Binding to XML is considerably slower in WPF. It is highly recommended to not bind to XML when working with large sets of records. XML parsing behind the scenes is more expensive performance-wise. And ObservableCollection has been optimized to be fast when working within WPF.

    For the XML version, make sure deferred scrolling is enabled. This will greatly speed up scrolling performance. If you need to use XML, send us a sample prototype and we can look at it to determine if there is anything that can be done to speed up performance.

    Thank you!