Skip to content

Loading…

Question: What is more efficient, Static or Dynamic Rules? #648

Closed
Mikey1993 opened this Issue · 12 comments

2 participants

@Mikey1993

As the title says.

If you can also include the selfie state of the filters, I would appreciate it.

Also, maybe adding a Wiki page about this one to make it more clear for people who are interested in the most efficient use of the addon like myself?

Thanks.

@ghost

How do you define efficiency? One thing is clear: Dynamic filters override static filters.

There should not be any difference between dynamic and static filters performance-wise, IMHO.

Another thing is usability. Dynamic filtering is only available for "experienced" users. However, I tend to the opinion that it is more difficult for an unexperienced user to understand and correctly apply ABP filter syntax. An experienced user can write more fine-grained static filters, though.

@Mikey1993

@tlu1024 I define efficiency as of code execution time for this matter.
I would like to have a comparison of the process of evaluation of the rules with both features.

Let's take the 3rd-party scenario:
I can block third party scripts via the ABP syntax, or by the Dynamic Filters.
So, which one is taking less resources in the process of evaluation?

@gorhill

@Mikey1993 : Dynamic filtering is more efficient: it's mere dictionary look-ups using hostname/type, as opposed to pattern-based filtering which involves scanning a URL. Also, toggling on/off a dynamic filter is virtually a noop compared to doing the same with a static filter, which require the whole reload of all static filters.

If you can also include the selfie state of the filters

I have no clue what that means

@tlu1024 : An non-advanced user is someone who also won't try to craft static filters. Not making dynamic filtering available to them doesn't imply at all that uBlock thinks they can deal with static filters either.

@gorhill gorhill closed this
@ghost

@gorhill

An non-advanced user is someone who also won't try to craft static filters. Not making dynamic filtering available to them doesn't imply at all that uBlock thinks they can deal with static filters either.

Agreed. On the other hand we're seeing many issues opened here about adding (exception) filters (for sometimes very specific purposes), and you are so kind to often add them to µBlocks's filter.txt. I wonder if it wouldn't make life easier for you if more users would be aware of Dynamic Filtering. I have no definite answer, I'm just thinking aloud.

@Mikey1993

@tlu1024 I agree, making people more aware of the Dynamic Filtering will make people more happy as they would merely need to "green" one by one and finally get it done, without opening any issues regarding static exception filters.

@gorhill I am referring to the selfies that are being made after some time after changing the static filters. I am wondering if them being generated, have any impact on the evaluation performance.

@gorhill

I am wondering if them being generated, have any impact on the evaluation performance.

No, it s just to optimize their storage for the next time they load. Irrelevant to filter evaluation.

@gorhill

if more users would be aware of Dynamic Filtering

Problem with dynamic filtering available to non-advanced users is that it's so easy to click on a cell, that a non-advanced user will do so wondering what that does, and then it breaks everything. It has happened before, and I am the one having to deal with this in the end. So dynamic filtering not accessible until explicitly accessed, and when this happens, warning "at your own risks" applies.

@Mikey1993

@gorhill But aren't you dealing with more problems from users regarding the static rules?
At the end, you can't ensure the user isn't doing something stupid as blacklisting all the inline rules and then wonder why so many pages are broken, but you can just guide them to unred all cells and then green 1 by 1 until the site works.

Isn't this a more simpler approach from your perspective than addressing static filters one by one?

@gorhill

blacklisting all the inline rules

Comparing "typing randomly in the My filters text area + clicking Apply changes" with "clicking a cell" makes no sense.

@Mikey1993

I think you lost me.
I was referring to the state of when the Dynamic Rules are ON even for novice users, so even if they are doing something stupid (like blocking the inline scripts globally with Dynamic Rules), and then opening an issue for that, it won't be too hard to just explain them how to unbreak the site, rather than making and effort to create and maintain a filter list of exception static rules.

@gorhill

Filter list of exception static rules benefits everybody, not just the one who reported the problem. You noticed I fixed one this morning. Well it benefits the one who reported the problem and all other users who visit the site.

Novice users will typically whitelist a site to un-break it. We all have novice users in our entourage. I do, and it has been clear since long that they don't care learning something they have no interest into. It's an observation, not a blame. Not respecting their lack of interests in learning technical details and forcing them to go through what they see as incantations is selfish -- and a lost cause of course.

Typically novice users couldn't care less about the intrications of dynamic filtering. That's just reality. Hence it's hidden by default so that they don't wander and mess up uBlock by inadvertance, while the big fat whitelist button is first thing they see.

The majority of users do not care about anything more complicated than clicking one button to un-break a site. I don't understand why it is so difficult to see and respect their point of view.

@Mikey1993

Well, you are right.
Novice users are there to be, you want it or not, it's reality,
so there is no 1 magical solution for everyone.

At least everyone is getting the exceptions you are working on, consciously or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.