[Mono-list] String comparisons slow

David S buttink at gmail.com
Wed Jul 21 04:00:13 EDT 2010


I take it back..... DAM YOU MISSING ZERO.

for ( int j=0; j < 40000; j++ ) // missing a 0 >.>

Output = 00:00:39.8547202 LOL I got pwned.

On Wed, Jul 21, 2010 at 3:57 AM, David S <buttink at gmail.com> wrote:

> I think there is another problem that is hidden behind all the complexity
> of your program. I can tell you this, it isn't string comparer.
>
> using System;
> using System.Collections.Generic;
> using System.Diagnostics;
>
> namespace StringCompare
> {
>
>
> public class MainClass
>  {
>
> public static void Main()
> {
>  List<List<string>> lists = new List<List<string>>();
> Random r = new Random();
>  for ( int i=0; i < 4; i++ ) {
> lists.Add( new List<string>() );
>  for ( int j=0; j < 40000; j++ )
> lists[i].Add( r.Next().ToString() );
>  }
> Stopwatch watch = new Stopwatch();
> watch.Start();
>  foreach ( List<string> list in lists )
> list.Sort();
> watch.Stop();
>  Console.WriteLine( watch.Elapsed );
> }
> }
> }
>
> OUTPUT = 00:00:03.1364747
>
> That being said I think its how you set up your threading. It could
> very easily be how Mono handles Threads (sleeping and such). Honestly, I
> have no idea, but I am intrigued.
>
> On Wed, Jul 21, 2010 at 3:31 AM, Stifu <stifu at free.fr> wrote:
>
>>
>> No release date, but Miguel recently said [1] "6-8 weeks from now."
>> No idea how it compares with the .NET GC.
>>
>> [1] http://tirania.org/blog/archive/2010/Jul-14.html
>>
>>
>> Mike Christensen-2 wrote:
>> >
>> > Is there a release date for 2.8?
>> >
>> > Also, how does the 2.8 GC (I realize it's only a beta) compare with the
>> > .NET GC?
>> >
>> > Mike
>> >
>> > On Tue, Jul 20, 2010 at 11:19 PM, Stifu <stifu at free.fr> wrote:
>> >>
>> >> There has been performance improvements since Mono 2.0. You may get
>> >> better
>> >> results with Mono 2.6. Or if you're not in a hurry, wait for Mono 2.8
>> >> which
>> >> should come out soon (that way you could also check out performances
>> with
>> >> the new GC).
>> >> --
>> >> View this message in context:
>> >>
>> http://mono.1490590.n4.nabble.com/String-comparisons-slow-tp2296525p2296643.html
>> >> Sent from the Mono - General mailing list archive at Nabble.com.
>> >> _______________________________________________
>> >> Mono-list maillist  -  Mono-list at lists.ximian.com
>> >> http://lists.ximian.com/mailman/listinfo/mono-list
>> >>
>> > _______________________________________________
>> > Mono-list maillist  -  Mono-list at lists.ximian.com
>> > http://lists.ximian.com/mailman/listinfo/mono-list
>> >
>> >
>>
>> --
>> View this message in context:
>> http://mono.1490590.n4.nabble.com/String-comparisons-slow-tp2296525p2296702.html
>> Sent from the Mono - General mailing list archive at Nabble.com.
>> _______________________________________________
>> Mono-list maillist  -  Mono-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-list
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20100721/50209bf1/attachment.html 


More information about the Mono-list mailing list