Performance

13 posts, 0 answers
  1. SteveL
    SteveL avatar
    68 posts
    Member since:
    Apr 2009

    Posted 26 Aug 2009 Link to this post

    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
  2. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 28 Aug 2009 Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. SteveL
    SteveL avatar
    68 posts
    Member since:
    Apr 2009

    Posted 04 Sep 2009 Link to this post

    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
  5. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 04 Sep 2009 Link to this post

    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.
  6. SteveL
    SteveL avatar
    68 posts
    Member since:
    Apr 2009

    Posted 04 Sep 2009 Link to this post

    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
  7. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 04 Sep 2009 Link to this post

    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.
  8. SteveL
    SteveL avatar
    68 posts
    Member since:
    Apr 2009

    Posted 04 Sep 2009 Link to this post

    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


  9. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 07 Sep 2009 Link to this post

    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.
  10. SteveL
    SteveL avatar
    68 posts
    Member since:
    Apr 2009

    Posted 17 Sep 2009 Link to this post

    Why does the memory usage keep increasing if you slide the scroll bar up and down?

    Steve
  11. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 18 Sep 2009 Link to this post

    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.
  12. SteveL
    SteveL avatar
    68 posts
    Member since:
    Apr 2009

    Posted 18 Sep 2009 Link to this post

    Thanks, Vlad. I look forward to Q3! :)

    Steve
  13. Brandon
    Brandon avatar
    10 posts
    Member since:
    May 2012

    Posted 02 May 2013 Link to this post

    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??
  14. Rossen Hristov
    Admin
    Rossen Hristov avatar
    2478 posts

    Posted 06 May 2013 Link to this post

    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.

Back to Top
UI for WPF is Visual Studio 2017 Ready