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

Issue 2989: Avoid the KMP overhead for simple indexOf() operations. (Closed)

Created:
12 years, 3 months ago by Dean McNamee
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Avoid the KMP overhead for simple indexOf() operations. Will look into evaluating the best cutoff between a simple search and KMP in the future. This improves some simple operations ~1.5x.

Patch Set 1 #

Patch Set 2 : Typo #

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

Messages

Total messages: 2 (0 generated)
Dean McNamee
12 years, 3 months ago (2008-09-19 12:13:09 UTC) #1
Mads Ager (chromium)
12 years, 3 months ago (2008-09-19 12:20:22 UTC) #2
LGTM

http://codereview.chromium.org/2989/diff/4/204
File src/runtime.cc (right):

http://codereview.chromium.org/2989/diff/4/204#newcode938
Line 938: // the overhead of setting up KMP.  TODO get more accurate cutoffs
here.
Either leave out the TODO or report a bug and use the bug ID here: TODO(bugid):
get more...

http://codereview.chromium.org/2989/diff/4/204#newcode941
Line 941: // the common case of the first character not matching is fast.
the the -> that the

http://codereview.chromium.org/2989/diff/4/204#newcode946
Line 946: for (int j = 1; j < pattern_length; ++j) {
I think we use j++ consistently in the rest of the code.  At least this should
be consistent with the outer for loop.

Powered by Google App Engine
This is Rietveld 408576698