4 ms·
Why not have a content blocker with much higher limits? If security is the aim why the limit for 50000 filter rules in use at one time?
by close04 7y ago
Why not have a content blocker with much higher limits? If security is the aim why the limit for 50000 filter rules in use at one time?
- xodice 7y agoI've yet to see a iOS or macOS content blocker that doesn't use multiple filter rules to bypass the 50k limit.
- danShumway 7y agoI'm not sure I understand. If everybody can bypass the 50k limit, what's the point of the limit? If the 50k limit isn't sufficiently high, I don't think, "they're trying to restrict blockers, but don't worry they're bad at it" is a great defense. And if the 50k limit is high enough, and it's a reasonable tradeoff between privacy and performance, then why are content blockers putting in extra work to bypass it? Should we expect that Apple will block the limit workaround in the future?
- hombre_fatal 7y agoOne guess: Without a limit, developers would probably default to a massive append-only list that takes a minute to compile. With a limit, developers have to shard their rules which lets them at least compile them in parallel. For example, you need to recompile the list if you want to support on-the-fly customizations like "whitelist this site."
- buran77 7y ago> bypass the 50k limit > when Apple rolled out the new Content Blocker API, it enforced a maximum limit of 50,000 rules for each new extension that wanted to block content inside Safari. Check again? You're probably thinking of how classic extensions used to work.
- nordsieck 7y ago> why the limit for 50000 filter rules in use at one time? Eventually more rules will cause a performance impact.
- close04 7y agoPut a disclaimer/warning and let the user decide whether the trade-off is worth it. Ads tend to have far higher performance and power consumption impact than this. Do Safari or Chrome force downscaled pictures and videos on you because it's faster? How is any other software "limited" for performance? And if this is a performance issue then why a fixed limit instead of one that varies with your system's performance? Edit. HN is "hinting" at me that a developer setting arbitrarily low limits "for performance" and not allowing a change is reasonable and expected. Strange place to be told that manufacturer defaults are sacred and the "advanced settings" checkbox should be abolished. For performance, stability, all that. :)
- glogla 7y agoThey can't possibly cause as much performance impact as allowing ads through.
- buran77 7y agoSo do tabs and I can still open 500 (maybe more already) on a 4 year old phone. No scenario I can imagine relies on having so many tabs open at once. The 50000 rules limit is far more crippling to blockers since you need those rules at once.
- stjohnswarts 7y agoHint: Those tabs aren't really tabs, they're pretty much just text links, they are not loaded into memory. 99% of them NOT running. If all 500 of those tabs ran in parallel you wouldn't be able to use your phone.
- saagarjha 7y agoIt’s kept low for performance. I wonder if they’ll revisit the limit at some point.
- quotemstr 7y agoWhat performance? Build a DDA out of the union of all the patterns and run it over each URL. Now you have O(1) (with low constant factors) matching no matter how many patterns you have. The DFA itself takes space and memory dereferences aren't free either, but even huge DFAs can be very compact.
- saagarjha 7y agoThey do build a DFA of the rules.
- buran77 7y agoThen why enforce the same limit for the iPhone 6s and a top of the line (i)Mac Pro? The elegant solution would be to start with a sensible preset for your device, allow you to change it if you want, and then warn you if some noticeable delays are detected. IE used to do this with addon loading.