[Mono-list] C# program in 2000 times slower than equivalent C program

Robert Jordan robertj at gmx.net
Thu Feb 28 12:28:33 EST 2008


Yury Serdyuk wrote:
> public static void local_quicksort ( int first, int last ) {
> 
>  int   k, l;
>  int   tmp;
> 
>  if ( first >= last )
>   return;
> 
>  int  pivot = x [ first ];
> 

This is wrong:

>  k     = 1;
>  l     = last;
> 
>  while ( x [ k ] <= pivot && k < last )
>   k++;

Robert



More information about the Mono-list mailing list