New Posts New Posts RSS Feed: Very slow sort with DevExpress DataGrid
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Very slow sort with DevExpress DataGrid

 Post Reply Post Reply
Author
f3rland View Drop Down
Newbie
Newbie
Avatar

Joined: 13-Sep-2007
Location: Canada
Posts: 25
Post Options Post Options   Quote f3rland Quote  Post ReplyReply Direct Link To This Post Topic: Very slow sort with DevExpress DataGrid
    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
Back to Top
f3rland View Drop Down
Newbie
Newbie
Avatar

Joined: 13-Sep-2007
Location: Canada
Posts: 25
Post Options Post Options   Quote f3rland Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
GregD View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 374
Post Options Post Options   Quote GregD Quote  Post ReplyReply Direct Link To This Post 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.)?
Back to Top
f3rland View Drop Down
Newbie
Newbie
Avatar

Joined: 13-Sep-2007
Location: Canada
Posts: 25
Post Options Post Options   Quote f3rland Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
GregD View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 374
Post Options Post Options   Quote GregD Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
f3rland View Drop Down
Newbie
Newbie
Avatar

Joined: 13-Sep-2007
Location: Canada
Posts: 25
Post Options Post Options   Quote f3rland Quote  Post ReplyReply Direct Link To This Post 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.


Edited by f3rland - 27-Feb-2009 at 1:50pm
F3
Back to Top
GregD View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 374
Post Options Post Options   Quote GregD Quote  Post ReplyReply Direct Link To This Post Posted: 27-Feb-2009 at 2:01pm
Do you get the performance lag if you call ApplySort() directly on the EntityList?
Back to Top
f3rland View Drop Down
Newbie
Newbie
Avatar

Joined: 13-Sep-2007
Location: Canada
Posts: 25
Post Options Post Options   Quote f3rland Quote  Post ReplyReply Direct Link To This Post Posted: 02-Mar-2009 at 5:13am
No, it took 00:00:00.0213860 to sort the list...
F3
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down