It surely must have something to do with the cancelable nature of AddNew().
In truth, they are fundamentally different operations and I would've
expected them to have potentially wildly different performance
characteristics.

On 10/31/06, Krebs Kristofer <[EMAIL PROTECTED]> wrote:

I found a weird thing while I was investigating a performance issue. We
use BindningList<T> as base class for our business object collections.
It seems that BindingList<T>.AddNew calls IndexOf(T item) (which has to
iterate and do Equals for all items in the collection to find it... it's
probably last) after the call to AddNewCore IF the item (of T) overrides
Equals or implements IEquatable<T>. This makes adding new items this way
go slower and slower. Adding object via the usual Add does not cause
this problem.

So, my question is why, and how can I avoid this behaviour?

===================================
This list is hosted by DevelopMentor�  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to