[Mono-bugs] [Bug 51675][Maj] New - We are wasting memory in CompareInfo operations

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 3 Dec 2003 19:24: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=51675

--- shadow/51675	2003-12-03 19:24:09.000000000 -0500
+++ shadow/51675.tmp.5462	2003-12-03 19:24:10.000000000 -0500
@@ -0,0 +1,40 @@
+Bug#: 51675
+Product: Mono/Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: CORLIB
+AssignedTo: dick@ximian.com                            
+ReportedBy: bmaurer@users.sf.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: We are wasting memory in CompareInfo operations
+
+Due to the way we are laying out some of the internal calls to ICU, we end
+up allocating lots of extra helper strings. This damages performance in
+APIs that are actually designed to be fast. In many cases, MSDN
+optimization recomendations result in programs that are far slower than the
+non-optimized version.
+
+A few api's that exhibit this behavior now are:
+		public virtual int Compare (string string1, int offset1,
+					    int length1, string string2,
+					    int offset2, int length2,
+					    CompareOptions options)
+		public virtual int IndexOf (string source, char value,
+					    int startIndex, int count,
+					    CompareOptions options)
+		public virtual int LastIndexOf(string source, char value,
+					       int startIndex, int count,
+					       CompareOptions options)
+
+Each of these allocates a string, even though they do not need to to
+perform their tasks. This can result in a dramatic, sometime visiable loss
+of performance. For example, bootstraping MCS has > 1mb of unneeded
+allocations due to this.