AdguardTeam / AdguardTeam/AdGuardHome

Use a Bloom filter as pre-check

Aperta
#7,928 0 commenti 2 reazioni 0 assegnatari Vedi su GitHub
feature request
Lingua principale
TypeScript
Stelle
36.9k
Fork
2.5k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### 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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.