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

Issue 6520004: Introduce new runtime function to make join with lower memory usage. (Closed)

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

Description

Introduce new runtime function to make join with lower memory usage. Do not use generic StringBuilderConcat which requires array passed to keep both elements and separator (which roughly double size of the array). That should be faster as well. BUG=crbug.com/54580 Committed: http://code.google.com/p/v8/source/detail?r=6777

Patch Set 1 #

Patch Set 2 : Removing unnecessary file #

Total comments: 1

Patch Set 3 : Following Anders' advice #

Unified diffs Side-by-side diffs Delta from patch set Stats (+82 lines, -10 lines) Patch
M src/array.js View 1 chunk +1 line, -9 lines 0 comments Download
M src/runtime.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/runtime.cc View 1 2 1 chunk +78 lines, -0 lines 0 comments Download
M test/mjsunit/fuzz-natives.js View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
antonm
Anders and Mads, may you have a look?
9 years, 10 months ago (2011-02-14 12:43:00 UTC) #1
Mads Ager (chromium)
LGTM
9 years, 10 months ago (2011-02-14 13:04:56 UTC) #2
sandholm
9 years, 10 months ago (2011-02-14 15:23:04 UTC) #3
LGTM with one comment.

http://codereview.chromium.org/6520004/diff/2001/src/runtime.cc
File src/runtime.cc (right):

http://codereview.chromium.org/6520004/diff/2001/src/runtime.cc#newcode5856
src/runtime.cc:5856: bool ascii = separator->HasOnlyAsciiChars();
You will always need a TwoByteString.
If everything is ascii then the %_FastAsciiArrayJoin call in the array.js file
would have produced an ascii result already.
I.e. you can safely remove the ascii variable and checks and inline the
StringBuilderJoinHelper function.

Powered by Google App Engine
This is Rietveld 408576698