r/programming • u/Daniel_Born • Apr 04 '17
Sorting in .NET
http://codingsight.com/sorting-in-net/1
u/mrexodia Apr 04 '17
What about Array.Sort?
1
Apr 04 '17
it uses the introspective sort: https://github.com/dotnet/coreclr/blob/master/src/mscorlib/src/System/Array.cs
also, random tip, if you want to do Array.Sort in descending order, you can make a generalized reverse comparer, and create and extension method for it:
https://github.com/jackmott/LinqFaster/blob/master/LinqFaster/Utils/ComparerMagic.cs#L11
1
u/_Mardoxx Apr 04 '17 edited Apr 06 '17
Why does it decreqse increase in performance when you install visual studio?
2
u/FrzTmto Apr 05 '17
Added calls are present to update stats so when Visual Studio is running, those are fed into the graphics that are shown (CPU use, etc.). You want information while developing, and users without VS will get a good speed because those components are more oriented to performance.
1
2
1
1
4
u/d_kr Apr 04 '17
Wow, I did not expect an in depth sort implementation comparision. Thankfully it is not a "101 some sort implementation in c#".