Skip to content

Group filters into sub groups #2

@mozbugbox

Description

@mozbugbox

Most of filter rules are domain specific. If we put filters start with "|", "||", "@@||" into their own list of rules with a given domain, then the giant regex will be cut into 1/3 of the original size. The domain specified rules will be quite short.

Each domain can then be put into a dict mapping to the respected filter rules.

And most rest of the rules have the string "ad" in it. if we seperate rest of the rules by whether a rule has "ad" in it, we can have a much smaller regex for urls without "ad".

domain_rules = {
"host1": merged_regex,
"host2": merged_regex
...
}
rules_with_ad = merged_regex
rules_without_ad = merged_regex

Since most false postive urls don't match domains and has no ad in them, matching false positive should be much faster.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions