Proposal: Optimizing Filter List Processing via Deduplication and Persistent Binary Cache #7787
DavidOsipov
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Everyone,
Back in August 2020, issue #2041 ("Adguard Home has high cpu usage, high memory usage...") highlighted significant performance challenges, particularly on resource-constrained devices like Raspberry Pis, when processing large numbers or sizes of filter lists. Key issues included:
While AdGuard Home has likely seen many improvements since v0.103.3 (discussed in #2041), the fundamental approach of parsing numerous, potentially large, and often redundant text-based filter lists on each startup or update remains a potential bottleneck, especially as list sizes grow.
Problem Recap:
The current reliance on processing plain text lists directly leads to:
Proposal:
I'd like to propose exploring an optimization strategy focused on deduplication and persistent binary caching of the processed filter rules, implemented entirely in pure Go (respecting the preference mentioned in #2041 to avoid CGO).
The core idea involves a workflow like this:
map[string]struct{}
or similar techniques).Potential Pure Go Implementation Options for Binary Cache:
encoding/gob
: Go's native binary serialization. Simple and efficient for Go data structures.Expected Benefits:
Discussion Points:
gob
, Protobuf, BoltDB/BadgerDB, etc.)?I believe implementing such a mechanism could significantly improve the user experience, especially for users managing extensive blocklists or running AGH on modest hardware.
Looking forward to hearing your thoughts and feedback!
Beta Was this translation helpful? Give feedback.
All reactions