in

CodeSmith Community

Your Code. Your Way. Faster!

Extreamly slow performance in the Fill method

Last post 05-16-2007 9:18 AM by katokay. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-30-2007 9:56 AM

    • SteveM
    • Not Ranked
    • Joined on 03-28-2007
    • Posts 7
    • Points 125

    Extreamly slow performance in the Fill method

    I think I must have something misconfigured in NetTiers.

    I have an account table that has 56 columns and 1700 records. When I run the following NetTiers code:
    TList<ACCOUNT> accounts = DataRepository.ACCOUNTProvider.GetAll();

    It takes 17 seconds to load.

    When I load the same records into you own object from the same sproc: i.e.
    Foreach(row in datareader)
    {
        Account account = new Account();
        account.name = (string)reader[“name”];
        …
    }

    It takes .6 seconds
    Can someone point me to where I should start debuging this? Is this normal?

    I am running NetTiers 2.0 and the Enterprize libs that come with its ziped download.

     

    • Post Points: 35
  • 05-16-2007 6:24 AM In reply to

    • dotnetbob
    • Not Ranked
    • Joined on 04-02-2007
    • Posts 5
    • Points 115

    Re: Extreamly slow performance in the Fill method

    I have the exact same problem.  I know that going throught the WebServiceClient and a WebService adds a low of overhead, but this is crazy.

    I generated my solution.  My database has 90 tables with lots of relationship.

    app.config:

    <configSections>

    <section name="netTiersService" type="Survey.Data.Bases.NetTiersServiceSection, Survey.Data" allowDefinition="MachineToApplication" restartOnExternalChanges="true"/>

    </configSections>

    <netTiersService defaultProvider="WsNetTiersProvider">

    <providers>

    <add name="WsNetTiersProvider" type="Survey.Data.WebServiceClient.WsNetTiersProvider, Survey.Data.WebServiceClient" url=http://localhost/Survey.WebServices/SurveyServices.asmx />

    </providers>

    </netTiersService>

    I have one form in my windows app with a grid on it.  here is the form load code:

    Imports Survey.Data

    Imports Survey.Entities

    Imports Survey.Data.WebServiceClient

    Imports System.Reflection

    Public Class TestForm

    Dim mContactsList As Survey.Entities.TList(Of Survey.Entities.Contacts)

    Private Sub TestForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    Dim start As DateTime = Now

    mContactsList = DataRepository.ContactsProvider.GetAll()

    Grid1.DataSource = mContactsList

    MessageBox.Show(DateDiff(DateInterval.Second, start, Now, FirstDayOfWeek.Sunday, FirstWeekOfYear.Jan1).ToString())

    End Sub

    End Class

    This takes 30 seconds. My Contacts table has 3 child tables, but I would think that is fine. (ContactEmails, ContactPhones, ContactAddresses)

    I have 100 contacts.

    The web page that was generated for this database loads the same data in a second or two.

    • Post Points: 35
  • 05-16-2007 9:18 AM In reply to

    • katokay
    • Top 25 Contributor
    • Joined on 07-09-2006
    • Salt Lake City, UT
    • Posts 142
    • Points 3,155

    Re: Extreamly slow performance in the Fill method

    I don't think the problem is exactly the same for the original post, but I would recommend reading this post about improving the performance of the WebServiceClient and any web service client for that matter. If the DataRepository.ContactsProvider.GetAll() is the first time the service gets called .net generates a large amount of serialization information for the first instantiation, thereafter the speed increases.
    • Post Points: 5
Page 1 of 1 (3 items)
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems