5 ms·
> "DDG Privacy Essentials does a simple object property lookup based on the request domain, an operation that is practically instantaneous" This sounds interes
by SeanDav 6y ago
> "DDG Privacy Essentials does a simple object property lookup based on the request domain, an operation that is practically instantaneous"
This sounds interesting. A bit of searching is not providing much enlightenment - anyone care to explain in a bit more detail?
Also, if it is so fast, why aren't all the filter add-ons doing it?
- PetahNZ 6y agoIts open source right? Could you not just look it up https://github.com/duckduckgo https://github.com/duckduckgo
- wereHamster 6y agouBlock Origin doesn't do much worse than DDG Privacy Essentials. A few percent perhaps? I'd say on par with it…
- esnard 6y agoWhen you have an array, it's way faster to check the existence of array[key], which is O(1), than to loop over the full array to find if one of the values match the one you're searching for, which is O(n). This is used in hash tables, for example: https://en.wikipedia.org/wiki/Hash_table https://en.wikipedia.org/wiki/Hash_table Object properties in JS are mostly the same thing. I guess other extensions can't do the same because they don't have a simple value to search in a whitelist, but rather a list of regex which must all be executed.
- gorhill 6y agoContent blockers in the same class as uBlock Origin ("uBO")[1] have the added burden of having to enforce generic filters which are independent of the request domains, they have to find a specific pattern in the request URL, including with support for wildcards. Even though, and despite this added burden, I will point out that uBO is almost as performant as DDG Privacy Essentials as per this report. Furthermore, uBO contains WASM modules but they are not used in the Chromium version of the extension since this would require to add a `wasm-eval` directive to uBO's extension manifest, something I prefer to avoid for the time being, I fear this would cause more lengthy validation of the extension by the Chrome Web Store. * * * [1] Able to enforce EasyList, EasyPrivacy et al.
- floatingatoll 6y agoSome filter addons perform complex logic trees based on properties other than the hostname(s) being loaded by the browser, and therefore take up more CPU and RAM for more wall-clock seconds to meet the needs of their increased complexity. They end up able to block more content than others, but that comes at a cost — which, as this page notes, can be much higher than anyone expected.
- pythux 6y agoTo add to the excellent answer from Gorhill, you might find this read interesting: https://0x65.dev/blog/2019-12-20/not-all-adblockers-are-born-equal.html https://0x65.dev/blog/2019-12-20/not-all-adblockers-are-born... It is a deep dive into how modern content blockers work and what kind of rules they have to enforce (they are usually much more complex than simple domains, though). As a side node, I recently ran a small experiment and found out that around 90% or blocking from Easylist/EasyPrivacy/uBO lists can be done based on domain information only. But of course this leaves a lot of corner cases where sites might break or ads might still show, and ultimately more granularity is needed to address these cases.