list vs bindinglist

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

I am developing a bunch of custom business objects and to hold collections I
am using the BindingList(of ) generic collection. Now I know that will come
useful if I want to directly bind that data to databound controls. If I dont
ever have such a need, would I see a significant performance improvement if
I moved it to a List(of ) generic collection?

TIA!
 
Hi

Here are two links about generics.
Commonly generic will get the performance improvement.

Performance The bottom line is this: if type checking is done at compile
time rather than at run time, performance improves. In managed code, casts
between references and values incur both boxings and unboxings, and
avoiding such casts can have an equally negative impact on performance.
Current benchmarks of a quick-sort of an array of one million integers
shows the generic method is three times faster than the non-generic
equivalent. This is because boxing of the values is avoided completely. The
same sort over an array of string references resulted in a 20 percent
improvement in performance with the generic method due to the absence of a
need to perform type checking at run time.

http://msdn.microsoft.com/msdnmag/issues/03/10/NET/

http://msdn.microsoft.com/msdnmag/issues/03/09/NET/


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
I understand that. But in my scenario I am debating between using
BindingList(of) vs List(of). Are there any significant performance gains I
will get if I went with List(of) and sacrificed the functionality gains of
BindingList(of) ?

Thanks!
 
Hi

Yes, since the BindingList will do more job, so it will be somewhat slower
than the list. But I think it will not get much performance improvement.

Collections and Data Binding
http://msdn.microsoft.com/msdnmag/issues/05/05/CuttingEdge/

Also recently, commonly we need the new feature of bindinglist compared to
list in ASP.NET, Winform, if you would do that now or in the further, I
suggest you use the BindingList.
Anyway, if you do care the performance and will not use the BindingList's
feature, you can use the List.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top