Bug 130788 - System.IO.StreamReader.ReadLine is incredibly inefficient (Ximian Bug #76399)
Summary: System.IO.StreamReader.ReadLine is incredibly inefficient (Ximian Bug #76399)
Status: RESOLVED WONTFIX
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: Mono (show other bugs)
Version: unspecified
Hardware: Other Other
: P5 - None : Normal
Target Milestone: ---
Assignee: E-mail List
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-26 16:35 UTC by Wade Berrier
Modified: 2005-11-28 03:17 UTC (History)
0 users

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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