[Mono-bugs] [Bug 357947] Performance problem with System.Data

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Feb 1 07:29:43 EST 2008


https://bugzilla.novell.com/show_bug.cgi?id=357947

User juraj at hotfeet.ch added comment
https://bugzilla.novell.com/show_bug.cgi?id=357947#c1





--- Comment #1 from Juraj Skripsky <juraj at hotfeet.ch>  2008-02-01 05:29:43 MST ---
Created an attachment (id=192762)
 --> (https://bugzilla.novell.com/attachment.cgi?id=192762)
profile

I've changed the foreach containing "dt.Rows.Remove(r);" to the following

for(int x = 0; x < 100; x++) {
    DataRow r = (DataRow)list[x];
    dt.Rows.Remove(r);
}

..so it doesn't take forever when profiling. Then I've run "mono --profile
dt.exe >profile.txt". The result is attached.

The problem is that System.Data.Common.Index::RebuildIndex() is called for the
removal of every single row. Rebuilding the index obviously takes some time.

Updating the index by only removing the right index entry will make things much
faster. System.Data.Common.Index has an internal method "Delete (DataRow row)"
for that purpose.

We should probably change the code in DataView.cs:

private void OnRowDeleted (object sender, DataRowChangeEventArgs args)

{

        /* ItemDeleted */

        int newIndex;

        newIndex = IndexOf (args.Row);

        UpdateIndex (true);

        OnListChanged (new ListChangedEventArgs (ListChangedType.ItemDeleted,
newIndex, -1));

}


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list