Peformance with aspxgridview

Posts   
 
    
juance2008
User
Posts: 6
Joined: 22-Feb-2009
# Posted on: 22-Feb-2009 16:56:36   

I am evaluating llblgen 2.6 with Aspxgrid Developer Express version 8.3.4. The grid data binding is through a llblgendatasource control, I use Selfservicing. The page works fine and sort too, but the computer also noticed something that is slower when the table used contains more records. My table is Orders (800 rec) from Northwind database. The problem is in the editing of data, using the online edition or via popup windows, form data load takes between 20 to 30 seconds to display, this is logically unacceptable in an environment of dynamic load. Is there any way to improve performance or is this some sort of incompatibility between llblgen and devexpress. The database engine is sql server 2008 and the IDE is Visual studio 2008

Thank you

John

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 22-Feb-2009 19:53:15   

Hi John,

To check what is happen, please do this:

  • Enable DQE tracing and check whether the grid pulls all data from the DB. With DQE tracing you could see what is the SQL generated and executed against DB.

  • Are you using fields mapped onto related fields? If so, maybe you get a lot of data loaded through lazy loading.

David Elizondo | LLBLGen Support Team
juance2008
User
Posts: 6
Joined: 22-Feb-2009
# Posted on: 23-Feb-2009 13:53:29   

Hi Daelmo

Method Enter: CollectionCore.Clear Method Exit: CollectionCore.Clear Method Enter: CollectionCore.Clear Method Exit: CollectionCore.Clear 'WebDev.WebServer.EXE' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System.Data.SqlServerCe\3.5.1.0__89845dcd8080cc91\System.Data.SqlServerCe.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. Method Enter: DaoBase.PerformGetMultiAction 'WebDev.WebServer.EXE' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\Microsoft.VisualBasic\8.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualBasic.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled. Method Enter: CreatePagingSelectDQ Method Enter: CreateSelectDQ Method Enter: CreateSelectDQ Generated Sql query: Query: SELECT [Northwind].[dbo].[Employeesw].[EmployeeID] AS [EmployeeId], [Northwind].[dbo].[Employeesw].[LastName], [Northwind].[dbo].[Employeesw].[FirstName], [Northwind].[dbo].[Employeesw].[Title], [Northwind].[dbo].[Employeesw].[TitleOfCourtesy], [Northwind].[dbo].[Employeesw].[BirthDate], [Northwind].[dbo].[Employeesw].[HireDate], [Northwind].[dbo].[Employeesw].[Address], [Northwind].[dbo].[Employeesw].[City], [Northwind].[dbo].[Employeesw].[Region], [Northwind].[dbo].[Employeesw].[PostalCode], [Northwind].[dbo].[Employeesw].[Country], [Northwind].[dbo].[Employeesw].[HomePhone], [Northwind].[dbo].[Employeesw].[Extension], [Northwind].[dbo].[Employeesw].[Photo], [Northwind].[dbo].[Employeesw].[Notes], [Northwind].[dbo].[Employeesw].[ReportsTo], [Northwind].[dbo].[Employeesw].[PhotoPath] FROM [Northwind].[dbo].[Employeesw]

Method Exit: CreateSelectDQ Method Exit: CreatePagingSelectDQ: no paging. Method Enter: DaoBase.ExecuteMultiRowRetrievalQuery Executed Sql Query: Query: SELECT [Northwind].[dbo].[Employeesw].[EmployeeID] AS [EmployeeId], [Northwind].[dbo].[Employeesw].[LastName], [Northwind].[dbo].[Employeesw].[FirstName], [Northwind].[dbo].[Employeesw].[Title], [Northwind].[dbo].[Employeesw].[TitleOfCourtesy], [Northwind].[dbo].[Employeesw].[BirthDate], [Northwind].[dbo].[Employeesw].[HireDate], [Northwind].[dbo].[Employeesw].[Address], [Northwind].[dbo].[Employeesw].[City], [Northwind].[dbo].[Employeesw].[Region], [Northwind].[dbo].[Employeesw].[PostalCode], [Northwind].[dbo].[Employeesw].[Country], [Northwind].[dbo].[Employeesw].[HomePhone], [Northwind].[dbo].[Employeesw].[Extension], [Northwind].[dbo].[Employeesw].[Photo], [Northwind].[dbo].[Employeesw].[Notes], [Northwind].[dbo].[Employeesw].[ReportsTo], [Northwind].[dbo].[Employeesw].[PhotoPath] FROM [Northwind].[dbo].[Employeesw]

Method Enter: CollectionCore.PerformAdd Entity to Add Description: Entity: North.EntityClasses.EmployeeswEntity. ObjectID: 79d30dcf-5b89-4f92-a319-d89cab3020fe PrimaryKey field: EmployeeId. Type: System.Int32. Value: 1 Index of added entity: 0 Method Exit: CollectionCore.PerformAdd Method Enter: CollectionCore.PerformAdd Entity to Add Description: Entity: North.EntityClasses.EmployeeswEntity. ObjectID: 67e27922-5c3a-482a-8926-bc54d88152ea PrimaryKey field: EmployeeId. Type: System.Int32. Value: 2 Index of added entity: 1 Method Exit: CollectionCore.PerformAdd Method Enter: CollectionCore.PerformAdd Entity to Add Description: Entity: North.EntityClasses.EmployeeswEntity. ObjectID: 72ad25d1-e657-472b-8bc4-ea979fee4a27 PrimaryKey field: EmployeeId. Type: System.Int32. Value: 3 Index of added entity: 2 Method Exit: CollectionCore.PerformAdd .................................

Entity to Add Description: Entity: North.EntityClasses.EmployeeswEntity. ObjectID: 72ad25d1-e657-472b-8bc4-ea979fee4a27 PrimaryKey field: EmployeeId. Type: System.Int32. Value: 3 Index of added entity: 1000 Method Exit: CollectionCore.PerformAdd

Method Exit: CollectionCore.PerformAdd Method Exit: DaoBase.ExecuteMultiRowRetrievalQuery Method Exit: DaoBase.PerformGetMultiAction Method Enter: EntityBase.CheckForRefetch Method Exit: EntityBase.CheckForRefetch: state is not OutOfSync Method Enter: EntityBase.CheckForRefetch Method Exit: EntityBase.CheckForRefetch: state is not OutOfSync Method Enter: EntityBase.CheckForRefetch Method Exit: EntityBase.CheckForRefetch: state is not OutOfSync Method Enter: EntityBase.CheckForRefetch Method Exit: EntityBase.CheckForRefetch: state is not OutOfSync

..................

This text in the result of debbuging, the table has 1000 records

Than you

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 23-Feb-2009 14:36:16   

1- You didn't answer this question:

  • Are you using fields mapped onto related fields? If so, maybe you get a lot of data loaded through lazy loading.

2- We can never know which code is producing the posted trace.

3- I noticed a Photo field is being fetched, are you displaying the photo in the grid, as this can pretty much degrade teh performance, try to exclude any un-wanted fields from being fetched.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 23-Feb-2009 15:26:34   

Also, the grid doesn't seem to use paging, did you set that up correctly? Your query fetches all the rows, (so a 1000), and as Walaa said, it includes blobs, so the total amount of data is pretty big. If you page on the client, everything is serialized and stored inside the grid, which is likely very slow. So the main thing would be to setup the paging to be done on the server side, which is a feature supported by the datasourcecontrol, so you'll only fetching a couple of rows, not all 1000.

Frans Bouma | Lead developer LLBLGen Pro
juance2008
User
Posts: 6
Joined: 22-Feb-2009
# Posted on: 23-Feb-2009 17:24:22   

The llblgendatasource pagination property is true, the aspxgridview too, but loading the page the pagination does not exist.

" So the main thing would be to setup the paging to be done on the server side, which is a feature supported by the datasourcecontrol, so you'll only fetching a couple of rows, not all 1000."

How do it ?

Thanks

John

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 23-Feb-2009 18:07:30   

Please post your page HTML and code behind.

Frans Bouma | Lead developer LLBLGen Pro
juance2008
User
Posts: 6
Joined: 22-Feb-2009
# Posted on: 23-Feb-2009 19:48:29   

Not code behind

the html page:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="WebApplication2._Default" %>

<%@ Register assembly="SD.LLBLGen.Pro.ORMSupportClasses.NET20" namespace="SD.LLBLGen.Pro.ORMSupportClasses" tagprefix="llblgenpro" %>

<%@ Register assembly="DevExpress.Web.ASPxGridView.v8.3" namespace="DevExpress.Web.ASPxGridView" tagprefix="dxwgv" %> <%@ Register assembly="DevExpress.Web.ASPxEditors.v8.3" namespace="DevExpress.Web.ASPxEditors" tagprefix="dxe" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server"> <title></title> </head>

<body> <form id="form1" runat="server">

<llblgenpro:LLBLGenProDataSource ID="LLBLGenProDataSource1" runat="server" 
    DataContainerType="EntityCollection" 



    EntityCollectionTypeName="North.CollectionClasses.EmployeeswCollection, North" 
    EnablePaging="True">

</llblgenpro:LLBLGenProDataSource>
<dxwgv:ASPxGridView ID="ASPxGridView1" runat="server" 
    AutoGenerateColumns="False" DataSourceID="LLBLGenProDataSource1" 
    KeyFieldName="EmployeeId">
    <Columns>
        <dxwgv:GridViewCommandColumn VisibleIndex="0">
            <EditButton Visible="True">
            </EditButton>
            <NewButton Visible="True">
            </NewButton>
        </dxwgv:GridViewCommandColumn>
        <dxwgv:GridViewDataTextColumn FieldName="EmployeeId" ReadOnly="True" 
            VisibleIndex="1">
            <EditFormSettings Visible="False" />
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn FieldName="LastName" VisibleIndex="2">
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn FieldName="FirstName" VisibleIndex="3">
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn FieldName="Title" VisibleIndex="4">
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn FieldName="TitleOfCourtesy" VisibleIndex="5">
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataDateColumn FieldName="BirthDate" VisibleIndex="6">
        </dxwgv:GridViewDataDateColumn>
        <dxwgv:GridViewDataDateColumn FieldName="HireDate" VisibleIndex="7">
        </dxwgv:GridViewDataDateColumn>
        <dxwgv:GridViewDataTextColumn FieldName="Address" VisibleIndex="8">
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn FieldName="City" VisibleIndex="9">
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn FieldName="Region" VisibleIndex="10">
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn FieldName="PostalCode" VisibleIndex="11">
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn FieldName="Country" VisibleIndex="12">
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn FieldName="HomePhone" VisibleIndex="13">
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn FieldName="Extension" VisibleIndex="14">
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn FieldName="Notes" VisibleIndex="15">
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn FieldName="ReportsTo" VisibleIndex="16">
        </dxwgv:GridViewDataTextColumn>
        <dxwgv:GridViewDataTextColumn FieldName="PhotoPath" VisibleIndex="17">
        </dxwgv:GridViewDataTextColumn>
    </Columns>
</dxwgv:ASPxGridView>
</form>
</body>

</html>

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 24-Feb-2009 08:19:58   

You didn't set paging on the grid. You should use something like:

<SettingsPager PageSize="10"></SettingsPager>
juance2008
User
Posts: 6
Joined: 22-Feb-2009
# Posted on: 24-Feb-2009 13:21:36   

I changed the page settings and does not work, but turning a property of the grid (Datasourceforcestandardpaging) works perfectly, just that I lose the functionality of summaries, filtering and grouping.

Thank you very much everyone for the responses, llblgen is a great product and your support too

My best regards

John

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 24-Feb-2009 15:44:04   

I'm not sure if it's possible with this grid, at least for client-side sets. the thing is that the grid will fetch a new page when it needs it, but it needs code for that. If I'm not mistaken the grid did require some DevExpress specific interface implementation on the datasource control for that (we don't implement that interface).

Frans Bouma | Lead developer LLBLGen Pro
juance2008
User
Posts: 6
Joined: 22-Feb-2009
# Posted on: 24-Feb-2009 16:31:48   

Hi Otis

Obviously there is some inconsistency in the grid, perhaps by their functional characteristics, such as updates to fail if your property (Callback) is active. However, taking into account these restrictions can be used without losing the potential benefits of llblgen.

Also know as yet the two products in depth, perhaps reading with more detail the documentation will discover shortcuts to a better use of both

Thank you, and perdon for my bad english

John