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

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Feb 1 08:06:10 EST 2008


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

User informatique.internet at fiducial.fr added comment
https://bugzilla.novell.com/show_bug.cgi?id=357947#c3





--- Comment #3 from Hubert FONGARNAND <informatique.internet at fiducial.fr>  2008-02-01 06:06:10 MST ---
ok but,if i remove the dataview part, removing speed is higher, but still 15x
slower than MS.NET

try this :
public static void DataRowViewTest()
                {
                        DateTime begin=DateTime.Now;
                        DataTable dt=new DataTable();
                        dt.Columns.Add("id",typeof(string));
                        dt.Columns.Add("parentid",typeof(string));
                        for (int j=0;j<10;j++)
                        {
                                for (int i=0;i<1000;i++)
                                {
                                        DataRow row=dt.NewRow();
                                        row["id"]=Guid.NewGuid();
                                        row["parentid"]=j.ToString();
                                        dt.Rows.Add(row);
                                }
                        }
                        DateTime end=DateTime.Now;
                        Console.WriteLine(" "+dt.Rows.Count+" rows inserted :
"+(end-begin));
                        begin=DateTime.Now;
                        ArrayList list=new ArrayList();
//                      DataView dv=dt.DefaultView;
//                      dv.RowFilter="parentid='0'";
//                      
//                      foreach (DataRowView row in dv)
//                      {
//                              list.Add(row.Row);
//                              
//                      }
//                      dv=null;
                        end=DateTime.Now;

                        foreach (DataRow row in dt.Rows)
                        {
                                list.Add(row);
                        }
                        Console.WriteLine("filter done!!! : "+(end-begin));
                        begin=DateTime.Now;
                        foreach(DataRow r in list)
                                dt.Rows.Remove(r);
                        end=DateTime.Now;
                        Console.WriteLine("line removed"+list.Count+"
"+(end-begin));
                        Console.ReadLine();

                }

it removes all the 10000lines :

on mono : (with MONO_DISABLE_MANAGED_COLLATION=yes)
10000 rows inserted : 00:00:00.4154760
filter done!!! : 00:00:00.0000140
line removed10000 00:00:01.1698200

on MS.NET 
10000 rows inserted : 00:00:00.1562470
filter done!!! : 00:00:00
line removed10000 00:00:00.0781235 (15x faster)


-- 
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