Very slow sort with DevExpress DataGrid
Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=1103
Printed Date: 28-Jul-2025 at 9:14pm
Topic: Very slow sort with DevExpress DataGrid
Posted By: f3rland
Subject: Very slow sort with DevExpress DataGrid
Date Posted: 27-Feb-2009 at 7:36am
We get a 2 seconds lag when sorting a DevExpress.XtraGrid.Views.Grid.GridView binded on EntityList.
EntityList contain under 30 records (11 columns) and binding are done through XtraGridBindingDescriptor.
I commented all code in CustomDrawCell and RowCellStyle without any improvement.
Any idea on what can cause that lag?
------------- F3
|
Replies:
Posted By: f3rland
Date Posted: 27-Feb-2009 at 1:19pm
I did a test using a DataSet instead of EntityList and I gain so much speed!!!
Why EntityList binding is so slow? Is there a work around?
------------- F3
|
Posted By: GregD
Date Posted: 27-Feb-2009 at 1:29pm
Originally posted by f3rland
I did a test using a DataSet instead of EntityList and I gain so much speed!!!
Why EntityList binding is so slow? Is there a work around? |
Is the grid displaying related entities (e.g., Order.Customer, etc.)?
|
Posted By: f3rland
Date Posted: 27-Feb-2009 at 1:31pm
Yes but I tried to include them as properties to master object too without any performance improvement.
------------- F3
|
Posted By: GregD
Date Posted: 27-Feb-2009 at 1:43pm
Originally posted by f3rland
Yes but I tried to include them as properties to master object too without any performance improvement. |
I'm not sure I know what you mean by that, since the related objects would already be represented by relation properties generated by the Object Mapper. But in any case, the most common cause of per performance in grid loading is that the related entities haven't been preloaded before you connect the EntityList to the grid. In that circumstances, populating each row of the grid requires one or more additional calls out to the data source to retrieve the related data.
Here's an article that describes the problem and the solution in detail:
http://www.ideablade.com/DevForceClassic/TechTips/techtip_turbocharge_your_data_grid.htm
Let me know if that's not your problem.
|
Posted By: f3rland
Date Posted: 27-Feb-2009 at 1:47pm
The performance problem is not a fetching one, in fact, objects are already in cache. The performance "lost" is when we resize the grid or sort any column... A sort of "paint event lag".
That "lag" does not appear anymore when binding the grid with a dataset.
Example :
- Data are already loaded
- All columns are shown (no grouping)
- Sort any column and BANG! wait 2 seconds for sort to be applied.
------------- F3
|
Posted By: GregD
Date Posted: 27-Feb-2009 at 2:01pm
Do you get the performance lag if you call ApplySort() directly on the EntityList?
|
Posted By: f3rland
Date Posted: 02-Mar-2009 at 5:13am
No, it took 00:00:00.0213860 to sort the list...
------------- F3
|
|