Answer to comments on uBlock Origin thread: https://github.com/gorhill/uBlock/commit/5733439f629da948cfc3cae74afa519f6cff7b7f as it seems I do not have permission to comment.
Hi,
First of all I'd like to personnaly thank you for all the work you do on uBlock Origin and other extensions, the source code of which have been an inspiration to me personally many times in the past.
I am also really excited that there are multiple people pushing for more accurate measurements of the efficiency of content-blockers and I think sharing methodologies, data and results is a great start!
It is interesting that the results you obtained diverge from the study published yesterday. If I understand correctly you got similar timings for uBlock Origin itself, but the numbers for Adblock Plus do not seem to match (45µs instead of ~19µs). I'd really like to understand where this difference could come from.
The setup we used for the (synthetic) benchmark was the following:
- The version of uBlock Origin we used was commit 29b10d215184aef1a9a12b715b47de9656ecdc3c
- The version of Adblock Plus we used was commit 34c49bbf029e586226220c067c50cec6e8bf8842 of the adblockpluscore repository
- The code used to run the benchmark for Adblock Plus is the following: https://github.com/cliqz-oss/adblocker/blob/master/bench/comparison/adblockplus.js
We initialized an instance of the CombinedMatcher
class using all the network filters (as it seems to be the case in the extension), then used the matchesAny
method of the matcher as an entry-point. Moreover, the parsing of the URLs were performed using tldts
and not included in the measurement. It could be that the parsing and preparation of requests in Adblock Plus is less efficient than in uBlock Origin (which I know is extremely efficient).
The focus of the study was specifically on the network matching engine of the content-blockers and it seems likely that other parts of the extensions are introducing overhead. That's why I really like the in-browser measurement you have setup in uBlock Origin. In the end I guess all of these can be valuable in some way.
Thanks for taking the time to also check the extension. Firstly, some of the optimizations are still being released so it is going to get faster in next update. Secondly, I would not call it inefficient because comparing Ghostery as a whole with uBlock Origin or Adblock Plus does not really make sense: they are not doing the same thing. There is indeed a content-blocker in Ghostery (using the code benchmarked in the study) but that is really not the only thing happening; in particular our anti-tracking tech allows to make sure that any request not blocked by the adblocker is safe and does not contain unique identifiers which could be used to track users. This fine filtering takes more work than simply blocking requests but the benefit is huge in terms of privacy protection and reduced potential breakage. We are working in parallel to make this part of the extension more efficient and it is continuously improving.