[Mono-dev] [Patch] Generic Array.Sort

Carlos Alberto Cortez calberto.cortez at gmail.com
Fri Aug 19 03:49:15 EDT 2005


Hello, 

Comments below:

El vie, 19-08-2005 a las 01:08 -0400, Ben Maurer escribió:
> > Hey,
> >
> > I've attached a patch containing the impl for the generic versions of
> > Array.Sort.
> 
> 1) all the combsort stuff can probably go, IMHO -- With generics, we will
> be able to inline stuff (it will take a bit of jit optimization though --
> we basically need to do inlining).

Currently we use combsort with simple types, which doesn't need to use
the CompareTo methods, since they have associated runtime instructions,
as far as I know. 

Second, if inlining could help us in this scenario, can it do it right
now? If that's not the case, we could keep these combsort methods and
remove them when we are ready.

> 
> 2) qsort <T> is unused
> 

It's used for the Comparison<T> sort version

> 3) compare<T> should be removed. You should use Comparer <T>.Default. I
> specially coded this class to be fast.
> 

Ok, let's keep it using Comparer<T>.Default

Carlos.





More information about the Mono-devel-list mailing list