Bug 83961 - Generalize the single character optimization of r114072
Summary: Generalize the single character optimization of r114072
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Benjamin Poulain
URL:
Keywords:
Depends on:
Blocks: 83968
  Show dependency treegraph
 
Reported: 2012-04-13 16:58 PDT by Benjamin Poulain
Modified: 2012-04-24 16:41 PDT (History)
5 users (show)

See Also:


Attachments
Patch (8.13 KB, patch)
2012-04-13 17:08 PDT, Benjamin Poulain
eric: review+
eric: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Poulain 2012-04-13 16:58:44 PDT
Some more testing shows:
-After r114071, the specialization/inline of r114072 gives little performance improvement
-The biggest gain is actually because we avoid a memory allocation. This should be generalized in WTF

I should move the improvement of r114072 over to WTF.

+ Do not go over the string when searching for a UChar > 0xff in a string of LChar
Comment 1 Benjamin Poulain 2012-04-13 17:08:38 PDT
Created attachment 137182 [details]
Patch
Comment 2 Benjamin Poulain 2012-04-13 17:14:11 PDT
This introduce a tiny regression (< 1%) for replaceUsingStringSearch() with 1 character string but we do not regress to levels prior to r114072.

On the plus side, this improves stringProtoFuncIndexOf() in similar ways to what was done for replaceUsingStringSearch().

I have an idea for another improvement for replaceUsingStringSearch().

If needed, I'll make a generalized inline version for replaceUsingStringSearch() and stringProtoFuncIndexOf().
Comment 3 Eric Seidel (no email) 2012-04-19 15:57:31 PDT
Comment on attachment 137182 [details]
Patch

This seems reasonable.  Could you add performance/testing information to your ChangeLog?  That would make this an easy r+.
Comment 4 Eric Seidel (no email) 2012-04-19 15:58:18 PDT
Comment on attachment 137182 [details]
Patch

I guess you have some perf information in the comments of the bug.  They would be much better in the ChangeLog.
Comment 5 Benjamin Poulain 2012-04-24 16:41:46 PDT
Committed r115132: <http://trac.webkit.org/changeset/115132>