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

Issue 608006: Don't externalize fresh strings. (Closed)

Created:
10 years, 10 months ago by Vitaly Repeshko
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Don't externalize fresh strings. With the current API the embedder has to extrenalize a string each time a string is encountered to avoid the cost of repeated character copying/conversion. The issue here is that the externalization cost itself is non-negligible (both in time and space) and should not be paid for a rarely used string. This change is an attempt to predict a string's usage frequency based on its freshness. A string is considered fresh if it was recently allocated in the new space. Committed: http://code.google.com/p/v8/source/detail?r=3878

Patch Set 1 #

Total comments: 1

Patch Set 2 : Review fixes. #

Patch Set 3 : Added usage tracking. #

Patch Set 4 : Typo. #

Patch Set 5 : Tracking of string usage. #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+149 lines, -0 lines) Patch
M src/api.cc View 1 2 3 4 7 chunks +69 lines, -0 lines 2 comments Download
M test/cctest/test-api.cc View 1 2 3 4 3 chunks +80 lines, -0 lines 4 comments Download

Messages

Total messages: 6 (0 generated)
Vitaly Repeshko
10 years, 10 months ago (2010-02-15 13:23:53 UTC) #1
Mads Ager (chromium)
LGTM I'm not sure about the limit though. It will be random whether a new ...
10 years, 10 months ago (2010-02-15 13:31:26 UTC) #2
Vitaly Repeshko
On 2010/02/15 13:31:26, Mads Ager wrote: > LGTM > > I'm not sure about the ...
10 years, 10 months ago (2010-02-15 13:38:31 UTC) #3
Vitaly Repeshko
So to sum up our IM discussion, there are two issues here: 1. Large strings ...
10 years, 10 months ago (2010-02-15 22:29:07 UTC) #4
Mads Ager (chromium)
LGTM http://codereview.chromium.org/608006/diff/7001/7002 File src/api.cc (right): http://codereview.chromium.org/608006/diff/7001/7002#newcode2467 src/api.cc:2467: // Records that the given string's characters were ...
10 years, 10 months ago (2010-02-16 08:16:19 UTC) #5
Vitaly Repeshko
10 years, 10 months ago (2010-02-16 18:56:42 UTC) #6
Thanks! Submitted.


-- Vitaly

http://codereview.chromium.org/608006/diff/7001/7002
File src/api.cc (right):

http://codereview.chromium.org/608006/diff/7001/7002#newcode2467
src/api.cc:2467: // Records that the given string's characters were copied to
some
On 2010/02/16 08:16:19, Mads Ager wrote:
> Could you update the comments in this class to make it clear that you do not
> have a counter per string?

Done.

http://codereview.chromium.org/608006/diff/7001/7003
File test/cctest/test-api.cc (right):

http://codereview.chromium.org/608006/diff/7001/7003#newcode474
test/cctest/test-api.cc:474: CHECK(small_string->CanMakeExternal());
On 2010/02/16 08:16:19, Mads Ager wrote:
> small_ -> large_

Oops. Done.

http://codereview.chromium.org/608006/diff/7001/7003#newcode511
test/cctest/test-api.cc:511: CHECK(small_string->CanMakeExternal());
On 2010/02/16 08:16:19, Mads Ager wrote:
> small_ -> large_

Ditto.

Powered by Google App Engine
This is Rietveld 408576698