Bug 130788

Summary: System.IO.StreamReader.ReadLine is incredibly inefficient (Ximian Bug #76399)
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Wade Berrier <wberrier>
Component: MonoAssignee: E-mail List <bnc-team-mono>
Status: RESOLVED WONTFIX QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Wade Berrier 2005-10-26 16:35:17 UTC
Trow reported the following:

Because it creates a new StringBuilder for each line and assembles the
string one character at a time, just running this:

  StreamReader reader;
  reader = new StreamReader ("a 1.7Mb text file");

  string line;
  while ((line = reader.ReadLine ()) != null) { }

Causes 10.7Mb of strings to be allocated.

------------------

Gonzalo has a fix for this in commit revison: 52004
Comment 1 Wade Berrier 2005-10-26 16:36:07 UTC
Aj, can you provide a SWAMP id?
Comment 2 Andreas Jaeger 2005-10-27 07:26:14 UTC
For which package?  In general we're not fixing such issues for a released product, this is something we should only fix for our next product.
Comment 3 Wade Berrier 2005-10-27 16:22:01 UTC
This is for the mono-core package.  I'd imagine it is mainly for beagle.
Comment 4 JP Rosevear 2005-10-27 17:05:32 UTC
Miguel recommended this fix to me Aj.
Comment 5 Andreas Jaeger 2005-10-27 17:19:17 UTC
What kind of impact will it have?  This is a bug rated as normal and I don't see a reason to submit it.  Everything works as intented, no security issue, no segmentation fault... This does not qualify as an update.
Comment 6 JP Rosevear 2005-10-27 19:21:12 UTC
It dramitically reduces memory usage.
Comment 7 Andreas Jaeger 2005-11-14 15:08:34 UTC
How dramitically?  do you have some numbers?
Comment 8 Andreas Jaeger 2005-11-24 10:00:41 UTC
No answers for this one - let's fix for 10.1.
Comment 9 JP Rosevear 2005-11-28 03:17:58 UTC
Its already in mono 1.1.10