This is a migrated thread and some comments may be shown as answers.

Performance

12 Answers 292 Views
GridView
This is a migrated thread and some comments may be shown as answers.
SteveL
Top achievements
Rank 2
SteveL asked on 26 Aug 2009, 07:59 PM
I have a GridView in its own window which opens from a menu click. It's bound to a table in an SQLite database using an ObjectQuery on an Entity Data Model. The table has 150,000 rows and 50 columns. It takes 15 seconds from the window opening before the first page of data is displayed, with a blank window displayed. I then set the DataLoadMode to Asynchronous, and now when the window opens, I get the column headers displayed, and the 'busy' indicator, which is an improvement, but it still takes 15 seconds to show the first page of data.

If your demo is loading a million rows in 2 seconds, what am I doing wrong?

One problem with setting the DataLoadMode to Asyncronous is that when I edit a cell, the 'busy' indicator comes back on, and the first page of the data is displayed again. My CellEditEnded handler just calls the SaveChanges() method of my Entities object. Should I be doing it a different way to avoid being taken back to the start of the data?

Steve

12 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 28 Aug 2009, 12:06 PM
Hello Steve,

The problem is because your grid have a lot of columns. We are aware of this issue and we are improving it. For Q3 we will introduce column virtualization with container recycling and this will greatly improve the loading time and scrolling speed. We will also improve the horizontal virtualization by introducing row recycling and the ability to turn on or off both virtualizations. So basically we will try to address all known issues (slow load time and scrolling with a lot of columns and option to turn off vertical virtualization). This improvements will also affect the memory usage by reducing it.

As for the loading indicator - if you update your project to use our latest internal assemblies you can use RowEditEnded event to call SaveChanges() instead of CellEditEnded. CellEditEnded is call for each cell and RowEditEnded will be called once you leave the edited row.

Let us know if you need more information.

Best wishes,
Hristo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
SteveL
Top achievements
Rank 2
answered on 04 Sep 2009, 08:58 AM
Will you be implementing 'data virtualization', where the grid only loads the data from the database that is needed for the rows currently displayed? As well as taking 15 seconds to load the data into the grid, the memory usage of my application goes up from 70 MB to a huge 450 MB!

Steve
0
Vlad
Telerik team
answered on 04 Sep 2009, 09:17 AM
Hello Steve,

Please check this demo (you will need to download it) for more info about data virtualization:
http://demos.telerik.com/wpf/?GridView/WPF/Performance/ServerSide

Regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
SteveL
Top achievements
Rank 2
answered on 04 Sep 2009, 12:01 PM
Vlad,

I've tried to implement this, but when I try to move to the next page I get : "The method 'Skip' is only supported for sorted input in LINQ to Entities. The method 'OrderBy' must be called before the method 'Skip'."

I found this: http://www.telerik.com/community/forums/wpf/gridview/virtualization.aspx

but I don't understand your answer. How do I provide default sorting? I'm using LINQ to Entities because my database is embedded SQLite. I tried changing the code to: view = new QueryableCollectionView(context.data.OrderBy(d => d.timestamp)); but that didn't help.

Steve
0
Vlad
Telerik team
answered on 04 Sep 2009, 12:09 PM
Hello Steve,

You can add SortDescriptor to the QueryableCollectionView.

Kind regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
SteveL
Top achievements
Rank 2
answered on 04 Sep 2009, 02:16 PM
Vlad,

My code now looks like this:
view = new QueryableCollectionView(context.data); 
 
SortDescriptor sd = new SortDescriptor(); 
 
sd.Member = "timestamp"
sd.SortDirection = ListSortDirection.Ascending; 
view.SortDescriptors.Add(sd); 

Now, when I try to change pages, I don't get the error, but my application uses all the CPU and stops responding.

I'm wondering if I would make things simpler for myself if I switched from SQLite to SQL Server 2008 Express and OpenAccess ORM...

Steve


0
Vlad
Telerik team
answered on 07 Sep 2009, 02:29 PM
Hello Steve,

I've attached small example with ADO.NET Entity Data Model - everything worked fine on my end.

Sincerely yours,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
SteveL
Top achievements
Rank 2
answered on 17 Sep 2009, 05:20 PM
Why does the memory usage keep increasing if you slide the scroll bar up and down?

Steve
0
Vlad
Telerik team
answered on 18 Sep 2009, 08:41 AM
Hello Steve,

When you scroll up and down the grid will destroy old rows and will create (and bind) new however garbage collector will collect all these. With Q3 we will introduce container recycling + advanced UI virtualization and you will get less memory usage.

All the best,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
SteveL
Top achievements
Rank 2
answered on 18 Sep 2009, 10:50 AM
Thanks, Vlad. I look forward to Q3! :)

Steve
0
Brandon
Top achievements
Rank 1
answered on 02 May 2013, 07:23 PM
Even with the latest DLL's, the memory increases a HUGE amount when scrolling through the grid, bound to a QueryableCollectionView.  Even with forced GC.Collect() calls, the memory usage does not decrease.  Any ideas??
0
Rossen Hristov
Telerik team
answered on 06 May 2013, 08:27 AM
Hi,

This three lines of code is what we use when we want to really force a garbage collection:

GC.Collect();

GC.WaitForPendingFinalizers();
GC.Collect();

We have profiled the grid many times with this GC code, but we could not find a memory leak as you describe.

If you think that you have found a memory leak, can you please provide a runnable sample project that clearly demonstrates that the grid is indeed leaking with time. We will profile it with JustTrace to see what is leaking and where.

Thanks in advance.

All the best,
Rossen Hristov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
SteveL
Top achievements
Rank 2
Answers by
Hristo
Telerik team
SteveL
Top achievements
Rank 2
Vlad
Telerik team
Brandon
Top achievements
Rank 1
Rossen Hristov
Telerik team
Share this question
or