AdguardTeam / AdguardTeam/AdGuardHome
Use a Bloom filter as pre-check
- Vorherrschende Sprache
- TypeScript
- Sterne
- 36.9k
- Forks
- 2.5k
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
### 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
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.