DescriptionAvoid 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 #
Messages
Total messages: 7 (4 generated)
|