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

Issue 551823002: Optimize _GrowableArray._join and _StringBase._interpolate. (Closed)

Created:
6 years, 3 months ago by Lasse Reichstein Nielsen
Modified:
6 years, 2 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Optimize _GrowableArray._join and _StringBase._interpolate. R=fschneider@google.com Committed: https://code.google.com/p/dart/source/detail?r=40800

Patch Set 1 #

Patch Set 2 : Remove badly merged changes. #

Patch Set 3 : Don't allocate new list in interpolate. #

Patch Set 4 : Update function-hash of interpolate. #

Patch Set 5 : tweak interpolate #

Patch Set 6 : Tweak _OneByteString.operator+ #

Total comments: 8

Patch Set 7 : Address comments #

Total comments: 9

Patch Set 8 : Address comments from srdjan. #

Patch Set 9 : Don't optimize one/two length interpolations (other CL does the one-case better) #

Total comments: 8

Patch Set 10 : Address comments #

Total comments: 2

Patch Set 11 : Removed operator+ change. Added more tests. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+370 lines, -67 lines) Patch
M runtime/lib/growable_array.dart View 1 2 3 4 5 6 7 8 9 1 chunk +61 lines, -11 lines 0 comments Download
M runtime/lib/string_patch.dart View 1 2 3 4 5 6 7 8 9 10 2 chunks +24 lines, -16 lines 0 comments Download
M runtime/vm/method_recognizer.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M tests/corelib/iterable_join_test.dart View 1 2 3 4 5 6 7 8 9 10 1 chunk +66 lines, -0 lines 0 comments Download
M tests/language/string_interpolate_test.dart View 1 2 3 4 5 6 7 8 9 10 1 chunk +218 lines, -39 lines 0 comments Download

Messages

Total messages: 21 (3 generated)
Lasse Reichstein Nielsen
6 years, 3 months ago (2014-09-11 06:16:28 UTC) #2
Florian Schneider
https://codereview.chromium.org/551823002/diff/100001/runtime/lib/string_patch.dart File runtime/lib/string_patch.dart (right): https://codereview.chromium.org/551823002/diff/100001/runtime/lib/string_patch.dart#newcode691 runtime/lib/string_patch.dart:691: String operator +(String other) { I'm not convinced about ...
6 years, 3 months ago (2014-09-11 13:27:36 UTC) #3
Lasse Reichstein Nielsen
https://codereview.chromium.org/551823002/diff/100001/runtime/lib/string_patch.dart File runtime/lib/string_patch.dart (right): https://codereview.chromium.org/551823002/diff/100001/runtime/lib/string_patch.dart#newcode691 runtime/lib/string_patch.dart:691: String operator +(String other) { If you can do ...
6 years, 3 months ago (2014-09-11 14:15:06 UTC) #4
Lasse Reichstein Nielsen
I tried a small micro-benchmark to see the difference. It is extreme for one-element interpolations, ...
6 years, 3 months ago (2014-09-11 14:24:23 UTC) #5
srdjan
I am not convinced about the need for this CL. The disadvantage of this CL ...
6 years, 3 months ago (2014-09-11 16:33:01 UTC) #7
Lasse Reichstein Nielsen
On 2014/09/11 16:33:01, srdjan wrote: > I am not convinced about the need for this ...
6 years, 3 months ago (2014-09-11 18:28:23 UTC) #8
srdjan
On 2014/09/11 18:28:23, Lasse Reichstein Nielsen wrote: > On 2014/09/11 16:33:01, srdjan wrote: > > ...
6 years, 3 months ago (2014-09-11 18:30:18 UTC) #9
srdjan
https://codereview.chromium.org/551823002/diff/120001/runtime/lib/growable_array.dart File runtime/lib/growable_array.dart (right): https://codereview.chromium.org/551823002/diff/120001/runtime/lib/growable_array.dart#newcode283 runtime/lib/growable_array.dart:283: // return _StringBase._interpolate(this); remove dead code https://codereview.chromium.org/551823002/diff/120001/runtime/lib/growable_array.dart#newcode288 runtime/lib/growable_array.dart:288: // ...
6 years, 3 months ago (2014-09-11 18:43:18 UTC) #10
Lasse Reichstein Nielsen
https://codereview.chromium.org/551823002/diff/120001/runtime/lib/growable_array.dart File runtime/lib/growable_array.dart (right): https://codereview.chromium.org/551823002/diff/120001/runtime/lib/growable_array.dart#newcode283 runtime/lib/growable_array.dart:283: // return _StringBase._interpolate(this); On 2014/09/11 18:43:17, srdjan wrote: > ...
6 years, 3 months ago (2014-09-11 19:04:00 UTC) #11
Lasse Reichstein Nielsen
Reduced complexity of interpolate. PTAL
6 years, 3 months ago (2014-09-15 07:20:48 UTC) #12
Ivan Posva
Thanks, -Ivan https://codereview.chromium.org/551823002/diff/160001/runtime/lib/growable_array.dart File runtime/lib/growable_array.dart (right): https://codereview.chromium.org/551823002/diff/160001/runtime/lib/growable_array.dart#newcode277 runtime/lib/growable_array.dart:277: while (nextElement is String) { Please add ...
6 years, 3 months ago (2014-09-16 14:57:32 UTC) #14
Lasse Reichstein Nielsen
https://codereview.chromium.org/551823002/diff/160001/runtime/lib/growable_array.dart File runtime/lib/growable_array.dart (right): https://codereview.chromium.org/551823002/diff/160001/runtime/lib/growable_array.dart#newcode277 runtime/lib/growable_array.dart:277: while (nextElement is String) { On 2014/09/16 14:57:32, Ivan ...
6 years, 3 months ago (2014-09-18 09:30:37 UTC) #15
Ivan Posva
On 2014/09/18 09:30:37, Lasse Reichstein Nielsen wrote: > https://codereview.chromium.org/551823002/diff/160001/runtime/lib/growable_array.dart > File runtime/lib/growable_array.dart (right): > > ...
6 years, 3 months ago (2014-09-19 17:20:52 UTC) #16
Lasse Reichstein Nielsen
Ack no, I didn't, sorry about that. Should be there now.
6 years, 3 months ago (2014-09-19 18:48:29 UTC) #17
Lasse Reichstein Nielsen
PTAL
6 years, 2 months ago (2014-09-25 10:53:29 UTC) #18
Florian Schneider
LGTM. Please make sure that all cases in _join, _interpolate and operator+ (non-OneByteString, non-String elements, ...
6 years, 2 months ago (2014-09-25 11:14:45 UTC) #19
Lasse Reichstein Nielsen
Committed patchset #11 (id:200001) manually as 40800 (presubmit successful).
6 years, 2 months ago (2014-09-30 08:28:27 UTC) #20
Lasse Reichstein Nielsen
6 years, 2 months ago (2014-09-30 09:17:45 UTC) #21
Message was sent while issue was closed.
https://codereview.chromium.org/551823002/diff/180001/runtime/lib/string_patc...
File runtime/lib/string_patch.dart (right):

https://codereview.chromium.org/551823002/diff/180001/runtime/lib/string_patc...
runtime/lib/string_patch.dart:683: }
I think I'll revert this operator for now and do some more tests.
It's no longer used in interpolate, so it really is a separate change.

Powered by Google App Engine
This is Rietveld 408576698