AdguardTeam / AdguardTeam/AdGuardHome

Use a Bloom filter as pre-check

Ouverte
#7,928 0 commentaires 2 réactions 0 personnes assignées Voir sur GitHub
feature request
Langage dominant
TypeScript
Étoiles
36.9k
Forks
2.5k
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

### The problem

Linear search over rules is asymptotically slow. It's usually good enough, but as the number of rules grows, or when we deploy it on underpowered hardware like consumer routers, this becomes a major issue

But only about 20~40% of all queries are actually blocked. Skipping the extensive matching for them can have a disproportional effect on performance.

### Proposed solution

Bloom filters are a probabilistic data structure that can tell you in O(1) if an element might belong to a set. Using this, we can quickly tell if a domain is certainly not in the block list and process that query. [Bloom Filters by Example](https://llimllib.github.io/bloomfilter-tutorial/) has been an excellent introduction to the topic.

Chrome already uses them for reducing Safe Browsing look-ups [](https://web.archive.org/web/20160306232658/http://blog.alexyakunin.com/2010/03/nice-bloom-filter-application.html) .

### Alternatives considered and additional information

Previously mentioned in #2041

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.