[Mono-list] Speed difference Windows - Linux
alan.mcgovern at gmail.com
Fri Jan 4 13:58:30 EST 2008
I really doubt that calling the Key, Value overload would give that much of
a slowdown. I'd believe a slowdown of 10%, or maybe 15%, but not 600%. I'd
say the slowdown is due to an inefficient algorithm as opposed to anything
On Jan 4, 2008 3:35 PM, Juraj Skripsky <js at hotfeet.ch> wrote:
> I've filed a bug report for this:
> - Juraj
> On Fri, 2008-01-04 at 16:10 +0100, Juraj Skripsky wrote:
> > I've found one potential problem in Array.Sort<T> (called by
> > List<T>.Sort) that could account for quite some slowdown.
> > All of the following "Sort<T>" method overloads call a "Sort<TKey,
> > TValue>" overload with null as the values/items array to get their work
> > done:
> > public static void Sort<T> (T  array)
> > public static void Sort<T> (T  array, IComparer<T> comparer)
> > public static void Sort<T> (T  array, int index, int length)
> > public static void Sort<T> (T  array, int index, int length,
> > IComparer<T> comparer)
> > This is suboptimal as those methods in turn use the swap<K, V> method
> > which needs to check (and then ignore) the values/items array.
> > So we're push popping a lot of unnecessary nulls on and off the stack
> > and checking them. And as swap<T> is a lot smaller than swap<K, V> its
> > chances for being inlined by the JIT compiler are much higher.
> > - Juraj
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-list