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 [EMAIL PROTECTED]

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

--- shadow/77382        2006-03-10 03:46:14.000000000 -0500
+++ shadow/77382.tmp.8394       2006-03-13 04:49:45.000000000 -0500
@@ -49,6 +49,36 @@
 It would be nicer if we can reduce extra allocation.
 
 One concern is that cultude dependent code should be avoided. So
 please replace String.StartsWith() with CompareInfo.IsPrefix(). Can
 you also please provide some performance comparison results with
 reproducible code?
+
+------- Additional Comments From [EMAIL PROTECTED]  2006-03-13 04:49 -------
+- "reduce extra allocation": the attached patch does just that.
+
+- "culture dependent code should be avoided": also done by the patch
+
+- "CompareInfo.IsPrefix": actually, since only 1- or 2-character
+prefixes are checked in Uri, I did explicit char-by-char comparison
+
+- "performance comparison": as stated above, 19 vs 25 allocations in
+the trivial case. A practical test of the execution time impact would
+involve a non-trivial amount of code to produce enough load on the CPU
+and GC to make the difference matter (this happened on a production
+system, but a small self-contained test case can hardly be extracted
+from it). Also, as stated above, the 19-25 allocation difference
+doesn't take into account the allocations made due to
+Mono.Globalization use, simply because they didn't occur after
+isolating a test case anymore. The reason for that is irrelevant to
+this bug report.
+
+I didn't preserve the test case I used, but it was basically just about:
+
+static void Main() {
+for(int i=0; i<10000; i++) {
+new Uri("http://something/";);
+}
+}
+
+Hope this helps.
+
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to