I was intrigued by Adblockfast, I could not get my head around on how the developer managed with only 7 rules which were derived from EasyList and Bluhell, so this morning in the train to school I had a look at AdBlockfast on Github.
The bold statement:
AdblockFast said:
Just as webpages grew bloated with ads, so too have ad blockers grown bloated with little-used filtering rules and features that sap their speed and hog your computer or device’s disk space, CPU cycles, and memory. Adblock Fast executes a mere 7 optimized filtering rules to accelerate pages 8x more but consume 6x less system resources than other ad blockers do.
Reading that I assumed that AdblockFast used some form of behavioral or heuristics mechanism, but then I read that the (only 7) rules were based on Easylist and Bluhelll
Adblockfast said:
Where does Adblock Fast’s filtering ruleset come from?
Adblock Fast’s ruleset is derived from EasyList and that of Bluhell Firewall.
That seemed weird to me, how could you fit in a 50.000+ ruleset into just 7 rules? I found the answer on Github. In one of the files the 7-rules blocklist was included and after looking at it, it turnout the be a gigantic piped and concatenated 7 line blocklist based on regular expressions. The regex looks at fragments of the webpages loaded and when the string matches any of the regex values it blocks it. Normally regex is a bit slower than ABP-rules so the developer pulled some tricks to make it run faster than AdblockPlus.
To the developer's credit he really looked upon adblocking from an interesting angle and pulled some remarkeable tricks to make it work, but when you copy the 7-rules Adblockfast into a word document, you end up with a 53 page document with a little less than 20.000 regex. So the 7-line rule file contains 19.076 regex rules, clever
In the picture below the | is replaced by X, so MsWord would tell me how much pipes (or's) were used in the 7 line rules file.