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

Issue 1888453011: Avoid multiple reallocations of StringBuffer._parts (Closed)

Created:
4 years, 8 months ago by sra1
Modified:
4 years, 8 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Base URL:
https://github.com/dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Avoid multiple reallocations of StringBuffer._parts The original code _parts = [ str ]; allocated a _GrowableList backed by a single element _List. Subsequent calls to _parts.add() grows the backing list to 2, then 4, etc. On a dart2js workload, allocating with a reasonable initial capacity reduces the number of _List objects allocated by 8%, with 4% reduction in _List bytes allocated. R=lrn@google.com Committed: https://github.com/dart-lang/sdk/commit/2bb2a12720db04afcf6162d3e4a7e30ed638ae1e

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -1 line) Patch
M runtime/lib/string_buffer_patch.dart View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 7 (4 generated)
sra1
4 years, 8 months ago (2016-04-16 23:43:52 UTC) #4
Lasse Reichstein Nielsen
lgtm
4 years, 8 months ago (2016-04-18 20:59:36 UTC) #5
sra1
4 years, 8 months ago (2016-04-19 01:08:28 UTC) #7
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
2bb2a12720db04afcf6162d3e4a7e30ed638ae1e (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698