Bug 143325 - [Content Extensions] Only add unique universal action locations.
Summary: [Content Extensions] Only add unique universal action locations.
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: 143338
Blocks:
  Show dependency treegraph
 
Reported: 2015-04-01 17:06 PDT by Alex Christensen
Modified: 2015-04-02 12:48 PDT (History)
1 user (show)

See Also:


Attachments
Patch (1.86 KB, patch)
2015-04-01 17:08 PDT, Alex Christensen
benjamin: review+
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-04-01 17:06:53 PDT
Right now we have waaaay too many actions on the DFA root.  That's slowing things down a lot.
Comment 1 Alex Christensen 2015-04-01 17:08:53 PDT
Created attachment 249954 [details]
Patch
Comment 2 Benjamin Poulain 2015-04-01 17:13:59 PDT
Comment on attachment 249954 [details]
Patch

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

> Source/WebCore/contentextensions/ContentExtensionCompiler.cpp:151
>  

You could take the opportunity to remove that blank line.
Comment 3 Alex Christensen 2015-04-01 17:18:04 PDT
http://trac.webkit.org/changeset/182265
Comment 4 Darin Adler 2015-04-02 09:05:50 PDT
Comment on attachment 249954 [details]
Patch

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

> Source/WebCore/contentextensions/ContentExtensionCompiler.cpp:136
> +    HashSet<uint64_t> universalActionLocations;

HashSet won’t work with 0 nor will it work with the maximum value. Do we have a guarantee that actionLocationAndFlags will never have either of those values?
Comment 5 Alexey Proskuryakov 2015-04-02 09:37:17 PDT
This patch made a test assert: https://webkit-test-results.appspot.com/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=http%2Ftests%2Fcontentextensions%2Fwhitelist.html

ASSERT(!HashTranslator::equal(KeyTraits::emptyValue(), key));

Looks like Darin's comment is spot on.
Comment 6 WebKit Commit Bot 2015-04-02 09:40:06 PDT
Re-opened since this is blocked by bug 143338
Comment 7 Alex Christensen 2015-04-02 12:48:54 PDT
I forgot the HashTraits :(

The value can be 0, so I used UnsignedWithZeroKeyHashTraits.  We only use the lowest 48 bits of the uint64_t, so it will never be the maximum 2 values.

http://trac.webkit.org/changeset/182283