Quantcast
Viewing all articles
Browse latest Browse all 764

CSLA performance issues with large data sets

Normal 0 false false false EN-US X-NONE X-NONE

Hello folks,

Though CSLA works quite nicely with smaller datasets I am seeing a performance issue when accessing larger data sets.  In particular I have a CSLA Read Only List Object that in some cases could contain over 19K child elements. In these cases, I am observing that Csla.ReadOnlyBase.LoadProperty chews up majority of time (in reflection) when building the list; and of course, this significantly impacts performance!   

 

{To the interested reader – the profiling data is given below}

 

Has anyone seen this performance issue before? 

Has this been fixed in the framework (I am currently using CSLA Ver 4.0.1.0) or is there a workaround?


Here’s the stack

Function Name

Inclusive Samples

Exclusive Samples

Inclusive Samples %

Exclusive Samples %

Module Name

-

MiddleTier.Library.AMS360ReadOnlyBase`1.LoadProperties(object)

6,562

1

96.01

0.01

MiddleTier.Library.DLL

-

MiddleTier.Library.AMS360ReadOnlyBase`1.LoadProperties(object,string[])

6,561

32

95.99

0.47

MiddleTier.Library.DLL

-

Csla.ReadOnlyBase`1.LoadProperty(class Csla.Core.IPropertyInfo,object)

5,544

43

81.11

0.63

Csla.DLL

 

System.RuntimeType.GetMethods(valuetype System.Reflection.BindingFlags)

1,633

1,633

23.89

23.89

mscorlib.ni.dll

 

System.Reflection.RuntimeMethodInfo.MakeGenericMethod(class System.Type[])

1,603

1,603

23.45

23.45

mscorlib.ni.dll

 

System.Reflection.MethodBase.Invoke(object,object[])

1,164

908

17.03

13.28

mscorlib.ni.dll

-

System.Linq.Enumerable.FirstOrDefault(class System.Collections.Generic.IEnumerable`1<!!0>)

929

334

13.59

4.89

System.Core.ni.dll

 

Csla.ReadOnlyBase`1.<LoadProperty>b__a(class System.Reflection.MethodInfo)

595

222

8.71

3.25

Csla.DLL

-

Csla.Reflection.MethodCaller.CallPropertyGetter(object,string)

570

50

8.34

0.73

Csla.DLL

 

Csla.Reflection.MethodCaller.GetCachedProperty(class System.Type,string)

413

9

6.04

0.13

Csla.DLL

   

And the function that takes up time

protectedvirtualvoid LoadProperty(IPropertyInfo propertyInfo, object newValue)

    {

     var t = this.GetType();

     var flags = System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance;

     var method = t.GetMethods(flags).Where(c => c.Name == "LoadProperty"&& c.IsGenericMethod).FirstOrDefault();

      var gm = method.MakeGenericMethod(propertyInfo.Type);

     var p = newobject[] { propertyInfo, newValue };

     gm.Invoke(this, p);

    }

 

thanks,

 


Viewing all articles
Browse latest Browse all 764

Trending Articles