none
Shared dataset performance RRS feed

  • Question

  • Not sure if this is the right forum...  I am refactoring an application I'm working on.  The dataset for the app is in it's own project called "datalayer".  Within that project is a class called "shares" which contains this shared property:

        Private Shared _after_hours As New datalayer.dsAfterHours
    Public Shared ReadOnly Property After_Hours() As datalayer.dsAfterHours
    Get
    Return _after_hours
    End Get
    End Property
    I also have a class called "dataOperations" which contains the routines for populating the dataset.  The "dataOperations" class is passed the dataset and it's connectionstring when it is initialized:

        Public Sub New(ByVal afterHours As datalayer.dsAfterHours, ByVal connectionString As String)
    Me.After_Hours = afterHours
    Me.ConnectionString = connectionString
    End Sub

    Private _after_Hours As New datalayer.dsAfterHours
    Public Property After_Hours() As datalayer.dsAfterHours
    Get
    Return _after_Hours
    End Get
    Set(ByVal value As datalayer.dsAfterHours)
    _after_Hours = value
    End Set
    End Property

    Private _connectionString As String
    Public Property ConnectionString() As String
    Get
    Return _connectionString
    End Get
    Set(ByVal value As String)
    _connectionString = value
    Me.After_Hours.SetConnectionString(value)
    End Set
    End Property
    When I call the routine to populate my parent table the load time is fairly instantaneous with this configuration.  However, I want to move the "shares" class to a separate project.  The problem is that when I move the "shares" class out of the "datalayer" project and into it's own project, the load time is noticeably longer.

    Is there a performance hit when I move a shared dataset out of the project that contains the typed dataset?  If so, why is that?  What am I missing?
    Monday, June 22, 2009 4:40 AM

Answers

  • I think profiling the code would be the best option here. That would likely help you identify where the issue is occuring.

    Thanks
    Chris Robinson
    Program Manager - DataSet
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Wednesday, June 24, 2009 5:26 PM

All replies

  • I think the best thing to do here is to profile the code. Below is a link to a blog post on profiling code

    http://blog.maartenballiauw.be/post/2008/02/Code-performance-analysis-in-Visual-Studio-2008.aspx

    I do not see how this issue is specifically related to dataset. My educated guess is that previously it would make all the calls in the same dll, but now that its in a different place its calling into another dll, perhaps this is slightly slower. If the version of VS you have doesn't have access to the VS profiler, then I would suggest just measuring the perf by printing out the time it took to get to various places and out put this to the console. Then you can figure out which specific piece of code is taking the most time. I wish I could give you a more specific answer but I'm not sure what the problem is.

    Thanks
    Chris Robinson
    Program manager - DataSet


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Tuesday, June 23, 2009 2:09 PM
  • Thanks for the reply.  I've spent quite a bit of time on this and no longer believe it has anytyhing to do with where the dataset is.  I'm thinking that somewhere a second call to populate the dataset is taking place, I'm just not sure where/how.


    Wednesday, June 24, 2009 4:33 AM
  • I think profiling the code would be the best option here. That would likely help you identify where the issue is occuring.

    Thanks
    Chris Robinson
    Program Manager - DataSet
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Wednesday, June 24, 2009 5:26 PM