Performance of :-abp-has()

Various discussions related to filter list maintenance

Moderator: njones

Performance of :-abp-has()

Postby humppa » Sun Aug 27, 2017 11:57 pm

Just for my comprehension:
Here it says
Also it is recommended that the selector inside a :-abp-has() starts with a combinator like >, + or ~. Otherwise a lot of elements will be needlessly selected as more that one ancestor will match.


So it is better to use
Code: Select all
site.com##.wrapper-safe:-abp-has(>.fb > div[class^="fb-col-"] > section > a.DealOfTheDay)

or
Code: Select all
site.com##.wrapper-safe:-abp-has(>div > div > section > .DealOfTheDay)

than this
Code: Select all
site.com##.wrapper-safe:-abp-has(.DealOfTheDay)

?
humppa
 
Posts: 5
Joined: Sun Feb 14, 2016 1:53 pm

Re: Performance of :-abp-has()

Postby lewisje » Tue Aug 29, 2017 9:43 am

yes, because it starts by looking for just direct descendants, not all descendants
There's a buzzin' in my brain I really can't explain; I think about it before they make me go to bed.
lewisje
 
Posts: 2711
Joined: Mon Jun 14, 2010 12:07 pm

Re: Performance of :-abp-has()

Postby humppa » Tue Aug 29, 2017 1:03 pm

Ok thanks, I just thought the many filters (costly: [attribute*="value"]) inside the braces could outweigh the benefits of starting with >.
Of course I understand it's always a matter of given site structure, too.
humppa
 
Posts: 5
Joined: Sun Feb 14, 2016 1:53 pm

Re: Performance of :-abp-has()

Postby sbell » Tue Aug 29, 2017 5:50 pm

I'm sorry, but we do not want to cover site-specific filter questions in the Adblock Plus forum.

The Adblock Plus project is deliberately not involved in authoring filters. The best place to get help for such questions is the forum of a filter list project such as EasyList.
sbell
 
Posts: 5
Joined: Wed Jul 05, 2017 8:08 pm

Re: Performance of :-abp-has()

Postby mapx » Tue Aug 29, 2017 8:19 pm

@sbell, it's about how to use certain features ABP is providing.

-abp-has is a new feature and the users are asking how to use it better.
User avatar
mapx
 
Posts: 20796
Joined: Thu Jan 06, 2011 3:01 pm

Re: Performance of :-abp-has()

Postby humppa » Tue Aug 29, 2017 8:32 pm

Thank you mapx, that's what I would have written if the topic wasn't locked.
Maybe sbell thought, site.com is a real site.
However, I think I got my answer and a new best practice for -abp-has:()

Thanks, keep up the good work :-)
humppa
 
Posts: 5
Joined: Sun Feb 14, 2016 1:53 pm

Re: Performance of :-abp-has()

Postby sbell » Wed Aug 30, 2017 8:16 pm

My apologies! The post was indeed redacted in error.
sbell
 
Posts: 5
Joined: Wed Jul 05, 2017 8:08 pm

Re: Performance of :-abp-has()

Postby humppa » Wed Aug 30, 2017 10:30 pm

@sbell
It's ok, that happens. We're all just people. Nice of you that you replied again!
humppa
 
Posts: 5
Joined: Sun Feb 14, 2016 1:53 pm


Return to Filter List Authors' Corner

Who is online

Users browsing this forum: No registered users and 2 guests