Bug 142295 - optimize content extension backend
Summary: optimize content extension backend
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-04 11:03 PST by Alex Christensen
Modified: 2015-03-04 20:54 PST (History)
2 users (show)

See Also:


Attachments
Patch (2.98 KB, patch)
2015-03-04 11:13 PST, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (3.14 KB, patch)
2015-03-04 19:15 PST, Alex Christensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.