[Mono-bugs] [Bug 52752][Wis] New - We need a fast array sorting method

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 11 Jan 2004 15:33:10 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by bmaurer@users.sf.net.

http://bugzilla.ximian.com/show_bug.cgi?id=52752

--- shadow/52752	2004-01-11 15:33:10.000000000 -0500
+++ shadow/52752.tmp.18231	2004-01-11 15:33:10.000000000 -0500
@@ -0,0 +1,46 @@
+Bug#: 52752
+Product: Mono/Runtime
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: bmaurer@users.sf.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: We need a fast array sorting method
+
+Right now, Array.Sort will box if you sort an array of, say, ints. This can
+cause alot of allocations. For example, in the attached sample, you get a
+memory profile that looks like:
+
+########################
+    9308 KB System.Array::qsort(Array,Array,int,int,IComparer)
+        9308 KB   794343 System.Int32
+  Callers (with count) that contribute at least for 1%:
+       30622  99 % System.Array::qsort(Array,Array,int,int,IComparer)
+########################
+    2806 KB System.Array::swap(Array,Array,int,int)
+        2806 KB   239498 System.Int32
+  Callers (with count) that contribute at least for 1%:
+      239498  100 % System.Array::qsort(Array,Array,int,int,IComparer)
+########################
+    2806 KB System.Array::GetValue(int)
+        2806 KB   239498 System.Int32
+  Callers (with count) that contribute at least for 1%:
+      239498  100 % System.Array::swap(Array,Array,int,int)
+########################
+     168 KB .T::.cctor()
+         168 KB        1 System.Int32[]
+  Callers (with count) that contribute at least for 1%:
+           1  100 % .T::.cctor(object,intptr,intptr)
+
+
+Of course, in realistic examples, it is not quite as dramatic, but you can
+still see it.