Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Issue 8639004: Fix excess memory usage problem in StringInputStream. (Closed)

Created:
9 years, 1 month ago by Bill Hesse
Modified:
9 years, 1 month ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Fix excess memory usage problem in StringInputStream. BUG=dart:555 TEST= Committed: https://code.google.com/p/dart/source/detail?r=1777

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -7 lines) Patch
M runtime/bin/string_stream.dart View 6 chunks +7 lines, -7 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Bill Hesse
Use a List<int> instead of a StringBuffer to accumulate characters. Solves the memory problem completely. ...
9 years, 1 month ago (2011-11-22 18:04:55 UTC) #1
Søren Gjesse
lgtm
9 years, 1 month ago (2011-11-23 07:37:13 UTC) #2
Mads Ager (google)
LGTM I think this change is fine. For this use a List<int> seems like the ...
9 years, 1 month ago (2011-11-23 07:41:22 UTC) #3
Mads Ager (google)
9 years, 1 month ago (2011-11-23 07:50:59 UTC) #4
Hmm, looking at the StringBuffer implementation in the VM I don't see why this
would make a huge difference. In the StringBuffer we are using a list of
strings. So, as far as I can tell, the size difference here should be a smallish
constant factor? Instead of storing a smi in the list we store strings. These
strings are allocated outside of the list itself. What is the precise size
reduction here? A factor of 3-5? I think it is fine to put this back, but it
will still be easy to exhaust new space. The VM team is working on a better GC
so this would be promoted to old space and not be an issue.

On 2011/11/23 07:41:22, Mads Ager wrote:
> LGTM
> 
> I think this change is fine. For this use a List<int> seems like the right
> thing. I do think that the StringBuffer should be able to handle this case
> better. As the user of a StringBuffer I would expect it to have better growth
> strategies so this code would not be a problem.

Powered by Google App Engine
This is Rietveld 408576698