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

Issue 1562001: Trim in some cases of Array.splice. (Closed)

Created:
10 years, 9 months ago by antonm
Modified:
9 years, 4 months ago
CC:
v8-dev
Visibility:
Public.

Description

Trim in some cases of Array.splice. Committed: http://code.google.com/p/v8/source/detail?r=4321

Patch Set 1 #

Total comments: 3

Patch Set 2 : Migrating to byte arrays as per Erik's suggestion #

Unified diffs Side-by-side diffs Delta from patch set Stats (+88 lines, -38 lines) Patch
M src/builtins.cc View 1 3 chunks +88 lines, -38 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
antonm
Mads, Lasse, may you have a look?
10 years, 9 months ago (2010-03-29 14:33:27 UTC) #1
antonm
Erik, would you mind reviewing it then? tia and yours, anton.
10 years, 8 months ago (2010-03-30 10:08:33 UTC) #2
Erik Corry
LGTM. If splice is carving a big chunk out of an array it would make ...
10 years, 8 months ago (2010-03-30 12:05:41 UTC) #3
antonm
Very cool idea about not copying large result arrays, thanks a lot, I'll give it ...
10 years, 8 months ago (2010-03-30 12:15:50 UTC) #4
antonm
10 years, 8 months ago (2010-03-30 12:16:31 UTC) #5
http://codereview.chromium.org/1562001/diff/1/2
File src/builtins.cc (right):

http://codereview.chromium.org/1562001/diff/1/2#newcode352
src/builtins.cc:352: MemsetPointer(former_start, filler_map, to_trim);
Anyway, I think that for now I'd better put it---it'd be easier to remove later.

On 2010/03/30 12:15:50, antonm wrote:
> On 2010/03/30 12:05:42, Erik Corry wrote:
> > It would be faster to put a byte array here in the case where the size is
more
> > than a few words.  Then you only have to tough the start.
> 
> That's true, but I have another idea: when I need to grow an array at the
start
> (for unshift and some forms of splice like splice(0, 0, ...), I can check if
> words before a single word fillers and reuse them.
> 
> That might be problematic if we ever store those maps in the objects (btw, do
> you know if we do), so I'd like to see performance impact first.  And if it's
> not worth it, then, yes, I'd switch to variable size fillers here.
>

Powered by Google App Engine
This is Rietveld 408576698