[Mono-bugs] [Bug 76399][Maj] Changed -
System.IO.StreamReader.ReadLine is incredibly inefficient
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Mon Oct 10 19:49:31 EDT 2005
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 gonzalo at ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=76399
--- shadow/76399 2005-10-10 19:25:06.000000000 -0400
+++ shadow/76399.tmp.17004 2005-10-10 19:49:31.000000000 -0400
@@ -38,6 +38,29 @@
like this though :-).
------- Additional Comments From gonzalo at ximian.com 2005-10-10 19:25 -------
Created an attachment (id=15900)
Proposed patch
+
+------- Additional Comments From gonzalo at ximian.com 2005-10-10 19:49 -------
+With this patch:
+ * we avoid creating the sb if the buffer contains a line delimiter
+(\r, \n or \r\n)
+ * Reuse the sb if it's not bigger than 32kb
+
+For a 1.7MB file, i get:
+gonzalo at lalo:/tmp/sr $ heap-buddy output
+
+ SUMMARY
+
+ Filename: output
+ Allocated Bytes: 3.9M
+Allocated Objects: 39041
+ GCs: 26
+ Resizes: 4
+ Final heap size: 348k
+
+ Distinct Types: 17
+ Backtraces: 63
+
+
More information about the mono-bugs
mailing list