[Mono-dev] How to improve Dataset Performance

APS dev.malst at apsystems.it
Wed Dec 9 08:09:25 EST 2009

For sure I can pass a test case, is better that I file a bug report? 
I think that Mono team already knows where datasets are slower than 
MS.Net and maybe can suggest me some "best practice".
Btw with the code provided below with MS.Net on a standard developer 
machine and Mono on a bi-processor testing machine (with 2GB of ram):

1000 rows
MS.Net: 130ms
Mono 2.4.3:  1.2s
Mono 2.0.1:  3.5s

10.000 rows
MS.Net: less than a second
Mono 2.4.3: 114s
Mono 2.0.1: 361s

I have tables with more than 50.000 rows...I don't know how much it 
takes to perform the elaboration. RowFilter speed up only if applied 
on small rowsets.
The problem is in the .Select method, removing those lines the 
elaboration is quicker in Mono. Testing machines are not with the 
same resources but the difference is too much to think to an hardware 
Here is the code...

             DataSet ds1 = new DataSet();
             ds1.Tables[0].Columns.Add("COL1", typeof(string));
             ds1.Tables[0].Columns.Add("COL2", typeof(int));
             ds1.Tables[0].Columns.Add("COL3", typeof(bool));
             for (int i = 0; i < 10000; i++) {
                 ds1.Tables[0].Rows.Add(new object[] { "test", i, true });
             DataSet ds2 = new DataSet();
             ds2.Tables[0].Columns.Add("COL1", typeof(string));
             ds2.Tables[0].Columns.Add("COL2", typeof(int));
             ds2.Tables[0].Columns.Add("COL3", typeof(bool));
             for (int i = 0; i < 10000; i++) {
                 ds2.Tables[0].Rows.Add(new object[] { "test", i, true });
             DataSet ds3 = new DataSet();
             ds3.Tables[0].Columns.Add("COL1", typeof(string));
             ds3.Tables[0].Columns.Add("COL2", typeof(int));
             ds3.Tables[0].Columns.Add("COL3", typeof(bool));
             for (int i = 0; i < 10000; i++) {
                 ds3.Tables[0].Rows.Add(new object[] { "test", i, true });
             int idx=0;
             foreach (DataRow dr in ds1.Tables[0].Rows) {
                 DataRow[] dr2 = ds2.Tables[0].Select("COL2=" + idx);
                 DataRow[] dr3 = ds3.Tables[0].Select("COL2=" + idx);


At 21.59 02/12/2009, Nagappan Alagappan wrote:
>Do you have a test case to reproduce this issue, which you could 
>share with the Mono team ?
>On Wed, Dec 2, 2009 at 4:05 AM, APS 
><<mailto:dev.malst at apsystems.it>dev.malst at apsystems.it> wrote:
>I'm testing some old elaboration that cycles on a large datatable and
>for every rows makes several selections on separated datatables.
>This elaboration is really slow on mono and fast on 
><http://MS.NET>MS.NET, let say
>400secs vs 4 secs.
>It seems that last rows are slower that first rows.
>I made some test on datasets scroll and I saw that mono performance
>is better than <http://MS.NET>MS.NET so the delay is due to inner selections.
>I changed datatable.select in defaultview.sort and I gained 200secs,
>still too slow.
>Now I've identified some datatable.compute as the main delay source.
>I'll try to change them using Linq but the question is: there's some
>known performance problem in dataset heavy usage, there's some best
>pratice that you can suggest to speed up elaborations?
>Thanks in advance.
>Mono-devel-list mailing list
><mailto:Mono-devel-list at lists.ximian.com>Mono-devel-list at lists.ximian.com
>Linux Desktop (GUI Application) Testing Project - 
>Il messaggio e' stato analizzato alla ricerca di virus o
>contenuti pericolosi da <http://www.mailscanner.info/>MailScanner, ed e'
>risultato non infetto.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20091209/3fec0d9d/attachment-0001.html 

More information about the Mono-devel-list mailing list