Bug 143325

Summary: [Content Extensions] Only add unique universal action locations.
Product: WebKit Reporter: Alex Christensen <achristensen>
Component: WebCore Misc.Assignee: Alex Christensen <achristensen>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 143338    
Bug Blocks:    
Attachments:
Description Flags
Patch benjamin: review+

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