Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How does Adblock Plus process its filters and which filters are faster?

0
Posted

How does Adblock Plus process its filters and which filters are faster?

0

All filters a translated into regular expressions internally, even the ones that haven’t been specified as such. For example, the filter ad*banner.gif| will be translated into the regular expression /ad.*banner\.gif$/. However, when Adblock Plus is given an address that should be checked against all filters it doesn’t simply test all filters one after another — that would slow down the browsing unnecessarily. Besides of translating filters into regular expressions Adblock Plus also tries to extract text information from them. What it needs is a unique string of eight characters (a “shortcut”) that must be present in every address matched by the filter (the length is arbitrary, eight just seems reasonable here). For example, if you have a filter |http://ad.* then Adblock Plus has the choice between “http://a”, “ttp://ad” and “tp://ad.”, any of these strings will always be present in whatever this filter will match. Unfortunately finding a shortcut for filters that simply don’t have eigh

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.