[MWF] DataGridViewRowCollection Clear() speed up
authorJim Westfall <jwestfall@surrealistic.net>
Sun, 9 Nov 2014 00:37:33 +0000 (16:37 -0800)
committerJim Westfall <jwestfall@surrealistic.net>
Sun, 9 Nov 2014 00:37:33 +0000 (16:37 -0800)
commit7d1b878fbf13462a282860c6d1dd493a48d7b1eb
treef9935606c592367761ef6d749bc9286adbe7d423
parent690a646c5e48f78313d16587a02a2380bf9e6c4d
[MWF] DataGridViewRowCollection Clear() speed up

When issuing a Clear() to remove all rows, a ReIndex() was being called for
each row that was being removed.  This is extremely inefficient, instead
do a single ReIndex() after all rows have been removed.

Before doing a Clear() of 30k rows was taking 5.8 seconds.  With this patch
it now takes 670ms.
mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewRowCollection.cs