Bug 142295

Summary: optimize content extension backend
Product: WebKit Reporter: Alex Christensen <achristensen>
Component: WebCore Misc.Assignee: Alex Christensen <achristensen>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, commit-queue
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Alex Christensen 2015-03-04 11:03:46 PST
Some small optimizations go a long way.

There's no need to add duplicate actions to the serialized list as long as order is preserved.  We can't check the whole list to see if a duplicate action has been added, because that would break ignore-previous-rules, but we can check the previous action, which is where most of the duplicate actions will be.

Also, ignore-previous-rules ignores the previous rules only in that extension, but block can return early without processing other extensions.
Comment 1 Alex Christensen 2015-03-04 11:13:36 PST
Created attachment 247872 [details]
Patch
Comment 2 Benjamin Poulain 2015-03-04 17:50:25 PST
Comment on attachment 247872 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=247872&action=review

> Source/WebCore/contentextensions/ContentExtensionCompiler.cpp:58
> +        if (ruleIndex && rule.action() == ruleList[ruleIndex - 1].action())
> +            continue;

I don't think that is right, actionLocations should point to actionLocations[ruleIndex - 1] instead of actions.size()
Comment 3 Alex Christensen 2015-03-04 19:15:18 PST
Created attachment 247920 [details]
Patch
Comment 4 WebKit Commit Bot 2015-03-04 20:54:33 PST
Comment on attachment 247920 [details]
Patch

Clearing flags on attachment: 247920

Committed r181065: <http://trac.webkit.org/changeset/181065>
Comment 5 WebKit Commit Bot 2015-03-04 20:54:36 PST
All reviewed patches have been landed.  Closing bug.