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

Issue 646010: Change the implementation of lastIndexOf method of String. Convert the string... (Closed)

Created:
10 years, 10 months ago by Oleg Eterevsky
Modified:
9 years, 5 months ago
CC:
v8-dev
Visibility:
Public.

Description

Change the implementation of lastIndexOf method of String. Convert the strings in question to Vector<char> or Vector<uc16> and execute simple search algorithm on them. The difference in speed on 500k character string is about 10x.

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Total comments: 3

Patch Set 6 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+76 lines, -20 lines) Patch
M src/runtime.cc View 1 2 3 4 5 3 chunks +76 lines, -20 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
Oleg Eterevsky
10 years, 10 months ago (2010-02-19 15:02:39 UTC) #1
Vitaly Repeshko
10 years, 10 months ago (2010-02-19 16:53:08 UTC) #2
LGTM.

Please fix a few nits and I'll land.


Thanks,
Vitaly

http://codereview.chromium.org/646010/diff/3004/3005
File src/runtime.cc (right):

http://codereview.chromium.org/646010/diff/3004/3005#newcode2475
src/runtime.cc:2475: int idx) {
Please add asserts about lengths and idx.

http://codereview.chromium.org/646010/diff/3004/3005#newcode2476
src/runtime.cc:2476: if (sizeof(pchar) > 1 && sizeof(schar) == 1) {
(nit) Swap conditions so that sub checks go before pat checks.

http://codereview.chromium.org/646010/diff/3004/3005#newcode4151
src/runtime.cc:4151: CONVERT_DOUBLE_CHECKED(number, args[0]);
Let's put this in a separate change.

Powered by Google App Engine
This is Rietveld 408576698