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

Issue 650058: Improve string runtime compare performance for flat strings. (Closed)

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

Description

Improve string runtime compare performance for flat strings. Committed: http://code.google.com/p/v8/source/detail?r=3949

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+88 lines, -20 lines) Patch
M src/objects.h View 1 chunk +0 lines, -4 lines 0 comments Download
M src/runtime.cc View 2 chunks +56 lines, -12 lines 4 comments Download
M src/utils.h View 2 chunks +32 lines, -4 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Vitaly Repeshko
Mads, Søren, This speeds up Dromaeo string compare by 16%. I'm doing some extra uint32_t ...
10 years, 10 months ago (2010-02-19 19:52:32 UTC) #1
Søren Thygesen Gjesse
LGTM http://codereview.chromium.org/650058/diff/1/3 File src/runtime.cc (right): http://codereview.chromium.org/650058/diff/1/3#newcode4639 src/runtime.cc:4639: if (x->IsFlat() && y->IsFlat()) { How about moving ...
10 years, 10 months ago (2010-02-22 10:14:00 UTC) #2
Vitaly Repeshko
10 years, 10 months ago (2010-02-25 12:50:10 UTC) #3
Thanks! Submitted.

BTW, uintptr_t turned out to be faster for large strings on x64.


-- Vitaly

http://codereview.chromium.org/650058/diff/1/3
File src/runtime.cc (right):

http://codereview.chromium.org/650058/diff/1/3#newcode4639
src/runtime.cc:4639: if (x->IsFlat() && y->IsFlat()) {
On 2010/02/22 10:14:00, Søren Gjesse wrote:
> How about moving the body of this if into a function, e.g. FlatStringCompare?
> 
> And make it into an if/else.

Done.

http://codereview.chromium.org/650058/diff/1/3#newcode4665
src/runtime.cc:4665: r = CompareChars(x_chars.start(), y_chars.start(),
prefix_length);
On 2010/02/22 10:14:00, Søren Gjesse wrote:
> There is a wmemcmp in wchar.h - don't know if it makes sense to use it here.

I'm worried about variations in wchar_t definitions.

Powered by Google App Engine
This is Rietveld 408576698