Optimize performence when large data in gridview and chart

1 Answer 40 Views
ChartView GridView
GXR
Top achievements
Rank 1
GXR asked on 05 Aug 2021, 09:31 AM | edited on 05 Aug 2021, 10:57 AM

Large data and realtime append data with mvvm like use ObservableCollection or RadObservableCollection, it will deny UI for some seconds. Large data mean the list count greater than 200k even 1000k.

 

Some sence like follow:

 

a gridview binding vm.list. then vm.list.Add(data) and list.Count is greater than 200k. UI lags. list is ObservableCollection

a chart series bind a vm.chartseries[0]. then vm.chartseries[0].Add(data) .

those are similar.

 

Could some controls have a nother mode to work without mvvm? like:

Task.Run(()=>{

gridview1.AppendData(data);

 

vm.LineSeries[0].MaxCount = 200000;

chart1.Series[0].AppendData(data);

//or

vm.LineSeries[0].AppendData(data);

})

 

In this mode ,controls can append data in other thread (not ui thread, and it can use a better performence collection class) quick and reflesh UI it self. And this mode have more potential for performance optimization

1 Answer, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 10 Aug 2021, 07:46 AM

Hello,

Generally speaking, both the RadGridView and RadChartView controls support updates to their bound data from another thread. For this to work as expected, however, the WPF guidelines must be followed.

I've prepared a small sample project which demonstrates how a large number of items (1 million) is added almost instantaneously by using the AddRange method of the RadObservableCollection.

Please have a look and let me know if a similar approach would work at your end. If that is not the case, please let me know what modifications I need to make to the sample project to better resemble your scenario. I will be awaiting your reply.

Regards,
Dilyan Traykov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

GXR
Top achievements
Rank 1
commented on 10 Aug 2021, 01:15 PM

Hello,

 

I mean the list already have large data, and i need to add data one by one, period one second.

such as it is a realtime updating chart or grid, every second it have a new data and add into list, but now one data need almost half even one second to add it and block UI,and than UI is almost stop, and if I have not only one chart or grid, Application will block until I close it. if I want to keep updating list count is 200k, I need remove the first element. It also block UI some time. Now it is a large fifo list. 

I think mvvm list is performance bottleneck. Perhaps mvvm list could faster a little. But AppendData method could design something new to have a extremely performence.

Dilyan Traykov
Telerik team
commented on 13 Aug 2021, 08:59 AM

Hello,
Generally speaking, it should not matter whether the collection is updated in an MVVM manner or by directly using the ItemsSource property of the RadGridView control. The same is valid for the RadChartView control.
You can have a look at the ChartView -> Live Data and GridView -> Real-time Update demos from our WPF Controls Samples application which demonstrate such real-time updates.
If you would send over a small sample project which demonstrates the issue you observe, I'd be more than happy to further investigate and suggest a possible solution. If you do not wish to make this project publicly available, you can open a new support ticket and attach it there.
Please let me know if you would find this possible.
GXR
Top achievements
Rank 1
commented on 13 Aug 2021, 01:31 PM

I known this demo. But it have a few data. You can try what will happen if it have more than 200k data and more line series.It will lag as I said. And gridview is same.
Dilyan Traykov
Telerik team
commented on 18 Aug 2021, 10:41 AM

Would you find it possible to modify these projects to demonstrate the issue you observe and send them over so that I can further investigate?
I tried doing so at my end, however, the performance of the controls is not affected.
If you would rather not share the projects publicly, you can create a new support ticket and attach them there.
Thank you in advance for your cooperation on the matter. I will be awaiting your reply.
Tags
ChartView GridView
Asked by
GXR
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or