AdguardTeam / AdguardTeam/AdGuardHome

Use a Bloom filter as pre-check

Abierto
#7,928 0 comentarios 2 reacciones 0 asignados Ver en GitHub
feature request
Lenguaje dominante
TypeScript
Estrellas
36.9k
Forks
2.5k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.