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

Issue 873863002: Improve performance of addAll for internallt known lists. (Closed)

Created:
5 years, 11 months ago by srdjan
Modified:
5 years, 10 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Improve performance of addAll for internallt known lists. Committed: https://code.google.com/p/dart/source/detail?r=43154

Patch Set 1 #

Patch Set 2 : #

Total comments: 4

Patch Set 3 : #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, -1 line) Patch
M runtime/lib/growable_array.dart View 1 2 2 chunks +16 lines, -1 line 4 comments Download

Messages

Total messages: 9 (2 generated)
srdjan
5 years, 11 months ago (2015-01-23 23:33:01 UTC) #2
srdjan
5 years, 11 months ago (2015-01-26 18:39:54 UTC) #4
Cutch
LGTMwS https://codereview.chromium.org/873863002/diff/20001/runtime/lib/growable_array.dart File runtime/lib/growable_array.dart (right): https://codereview.chromium.org/873863002/diff/20001/runtime/lib/growable_array.dart#newcode156 runtime/lib/growable_array.dart:156: final isList = maybe rename isBuiltinList, isVMList? https://codereview.chromium.org/873863002/diff/20001/runtime/lib/growable_array.dart#newcode171 ...
5 years, 11 months ago (2015-01-26 20:56:38 UTC) #5
srdjan
https://codereview.chromium.org/873863002/diff/20001/runtime/lib/growable_array.dart File runtime/lib/growable_array.dart (right): https://codereview.chromium.org/873863002/diff/20001/runtime/lib/growable_array.dart#newcode156 runtime/lib/growable_array.dart:156: final isList = On 2015/01/26 20:56:38, Cutch wrote: > ...
5 years, 11 months ago (2015-01-26 21:34:09 UTC) #6
srdjan
Committed patchset #3 (id:40001) manually as r43154 (presubmit successful).
5 years, 11 months ago (2015-01-26 21:50:45 UTC) #7
Lasse Reichstein Nielsen
LGTM too. Sorry for being slow. https://codereview.chromium.org/873863002/diff/40001/runtime/lib/growable_array.dart File runtime/lib/growable_array.dart (right): https://codereview.chromium.org/873863002/diff/40001/runtime/lib/growable_array.dart#newcode159 runtime/lib/growable_array.dart:159: (cid == ClassID.cidImmutableArray); ...
5 years, 11 months ago (2015-01-27 15:13:57 UTC) #8
srdjan
5 years, 10 months ago (2015-01-29 17:42:19 UTC) #9
Message was sent while issue was closed.
https://codereview.chromium.org/873863002/diff/40001/runtime/lib/growable_arr...
File runtime/lib/growable_array.dart (right):

https://codereview.chromium.org/873863002/diff/40001/runtime/lib/growable_arr...
runtime/lib/growable_array.dart:159: (cid == ClassID.cidImmutableArray);
On 2015/01/27 15:13:57, Lasse Reichstein Nielsen wrote:
> Would it be worth it to recognize growable list as well in setRange?

I think so, but we would need to move it here since cid-s are VM specific stuff.
Comparing cids is faster than instanceof test.

https://codereview.chromium.org/873863002/diff/40001/runtime/lib/growable_arr...
runtime/lib/growable_array.dart:173: throw new
ConcurrentModificationError(this);
On 2015/01/27 15:13:57, Lasse Reichstein Nielsen wrote:
> This does change behavior (it now throws before adding the first element), but
> nobody should be depending on that, so that's fine with me.
> 
> Of the internal lists, only GrowableObjectArray will reach here, the other
ones
> throw immediately when calling addAll, but the boolean is already computed, so
> it's probably just as good as comparing cid to ClassID.cidGrowable....
> Might be worth a comment though, so the _setLength below isn't confusing
anyone
> into thinking you change the length of an Array.

I do not understand. 'this' is always GrowableObjectArray.

Powered by Google App Engine
This is Rietveld 408576698