Page 1 of 1

WPF bindable - performance loss?

Posted: Thu Nov 09, 2017 1:12 pm
by speciesxx
Hi all,

we're evaluating the LCU suite for real time data monitoring. In the manual there are 3 kind of chart editions specified, with each their own performance:
- WPF non-bindable (Excellent)
- WPF semi-bindable (Very good)
- WPF bindable (Good)

Since we use MVVM, we wonder how big the performance loss is between the 3 editions. And why there is any performance loss? Is there any way we can compensate for this, or work around the loss?

Will it make any difference if we create an own UserControl which will encapsulate the WPF non-bindable edition. And on that UC create an own bindable (dependency)property for the data (e.g. ObservableCollection<double>())
Once the property changes, catch the event and update the chart series data according. The updating of the data will look like this:

Code: Select all

chartView.SampleDataSeries.Add(series);
(probably your bindable chart control does exactly the same ?)

Note: our data will come from an external device, which will eventually update our viewmodel data points (which we want to show in the chart)

Thanks in advance.

Re: WPF bindable - performance loss?

Posted: Fri Nov 10, 2017 6:53 am
by ArctionPasi
Hello,

Giving exact performance comparison between these editions is impossible as it depends on the use case so much.

Non-bindable is fastest because we can use parallel computation for practically everything, and the data point arrays can be accessed directly in linear memory space.

Binding needs observable collections and DependencyProperties and both have significant performance affect.

Fully bindable chart does not have any internal adapter between application's data and internal point handling. The chart is handling the application's observable collections when it's refreshing itself, or otherwise needs get access to data.

For your case, if max performance is required, I would recommend using non-bindable. If more convenient usage in MVVM is preferred, use semi-bindable. Semi-bindable supports binding other things, but just give data as an array of data points.