SfDataGrid virtualization performance

Dear Sirs, I'm testing the performance of a read only sfdatagrid which is bound to a large DataTable (300k rows and about 80 columns). I need to bind it to a datatable as I have dynamic queries (columns are not the same every time and so I cannot use pre-defined collections).

Code is:

MysfDataGrid.DataSource = MyDataTable;
MysfDataGrid.EnableDataVirtualization = true;
MysfDataGrid.UsePLINQ= true;

I notice that when my sfdatagrid has been loaded with data, the memory used by the process grows of about 900 MB, while the same data in an excel file consumes about 300 MB of memory.

Do I miss anything in my sfdatagrid? Do I need to enable other properties? Is there any other best practice to reduce the memory usage?

Thanks
L

Edit: I forgot to mention that column filtering and column sorting capabilities are required


5 Replies

VS Vijayarasan Sivanandham Syncfusion Team March 26, 2020 03:45 PM UTC

Hi Livio,

Thank you for contacting Syncfusion support.

We have analyzed your query and we have prepared a sample for SfDataGrid with 80 Columns based on your requirement. In this Sample, we have inserted 300000 records in a Button click and here all the records getting loaded at a considerable time.

Please find the tested sample and video demo from our end in the below link,

Sample Link: https://www.syncfusion.com/downloads/support/forum/152704/ze/PerformanceSample-1946470549

Video Link: https://www.syncfusion.com/downloads/support/forum/152704/ze/Performance-143797859

If still you are facing the same issue, can you please share us below things? 
1.       How many columns should be visible when DataGrid loaded? 
2.       Please modify the sample based on your scenario along with the replication procedure that would be helpful for us to proceed further and resolve the issue 

Please let us know, if you need any further assistance on this.
 
Regards,
Vijayarasan S 



LI Livio March 26, 2020 06:54 PM UTC

Thanks Vijayarasan,
your example is similar to my code.

I notice that in your example, memory usage is about 500 MB.

Is there any practice to reduce it? A kind of virtual scroll/data-cache which loads the required rows (for example 200 rows) into the sfgrid only when scrolling, keeping memory usage low?


VS Vijayarasan Sivanandham Syncfusion Team March 27, 2020 01:30 PM UTC

Hi Livio, 
In our provided sample contains SfDataGrid.AutoSizeColumnsMode property set as value as AllCells. This can be increasing memory used by the process grows 500 MB. If, your sample contains SfDataGrid.AutoSizeColumnsMode property when removing this loading performance can be improved. the memory used by the process grows from 300 to 400 MB. Please refer the modified sample for your reference,  



LI Livio April 3, 2020 05:37 PM UTC

Yes Vijayarasan, I know that AutoSizeColumnsMode has to be "None" to reduce memory usage. I would like to understand if there is another way to reduce it more.
Thanks

Regards


VS Vijayarasan Sivanandham Syncfusion Team April 6, 2020 04:33 PM UTC

Hi Livio,

In provided sample only without SfDataGrid data populating takes memory used by the process grows 300 MB. SfDataGrid renderer in sample it takes memory used by the process grows 400 MB. The performance can be improved by enabling EnableDataVirtualization property in SfDataGrid. Please find the tested sample and video demo from our end in the below link,

Sample Link:
https://www.syncfusion.com/downloads/support/forum/152704/ze/Sample-1923345685 
Video Link: https://www.syncfusion.com/downloads/support/forum/152704/ze/SfDataGridPerformance-2025375336

Regards,
Vijayarasan S


Loader.
Up arrow icon