Fix my slow/snail filters?

Posting here is no longer possible, please use the forum of a filter list project, such as EasyList
Locked
Slow filters

Fix my slow/snail filters?

Post by Slow filters »

OK, I have a few custom filters, that get the "snail" icon...I don't really know if they are slowing my browsing down (it's only 3 filters & I can't tell any difference), but if possible, I'd like to replace them with non-snail filters. Problem is, I don't think they CAN be non-snailed...
  • News701$font
  • roman$font
  • serif$stylesheet,font
...that's it, 3 filters to stop certain "serif" or "roman" fonts & a specific filter for a font called "News701", that I couldn't block with a more-generic filter.

I read somewhere that 8 chars for the "optimized filters" was "chosen arbitrarily", so couldn't filters with less chars be optimized? Why not 3 or 5 chars? 8 chars is way too many chars for some filters -- I can't block what I need AND make ABP happy about my filter name length.

So, is there anyway to add some chars to those filters & have them still work? -- or can ABP by modified to accept lower than 8 chars & consider them "non-snail" filters. If 8 chars was "chosen arbitrarily"...then I think it should be lowered -- or exposed in a pref so I can change it.
User avatar
Gingerbread Man
Posts: 1339
Joined: Fri Aug 12, 2011 5:28 am

Re: Fix my slow/snail filters?

Post by Gingerbread Man »

What's important is having delimiter characters. For example, supercalifragilisticexpialidocious is 34 characters long, but it's still a slow filter. Conversely, ||foo^ and :bar. are both optimized filters.

Provide at least one example of a page where your 3 filters match if you want suggestions for alternate filters. Otherwise, don't worry about it. 3 slow filters don't have any noticeable impact on performance.
Slow filters

Re: Fix my slow/snail filters?

Post by Slow filters »

Gingerbread Man wrote:What's important is having delimiter characters. For example, supercalifragilisticexpialidocious is 34 characters long, but it's still a slow filter.
...wow, so when DOES the "8 chars" come into play? That's horrible (& odd) that "supercalifragilisticexpialidocious" isn't "long enough" to make ABP happy. Don't get me wrong, I'm not complaining...it's just "odd"...what makes that a "slow filter"?
Gingerbread Man wrote:Provide at least one example of a page where your 3 filters match...
...all 3 filters don't match on 1 page, but...

For News701$font & roman$font...
...which loads...
For serif$stylesheet,font...
...which loads...
...which loads...
...but remember that I want to keep them as "general" as possible. I want to block ANY font on ANY site that says "serif"...anywhere in the path (are there any "delimiter characters" that will help with this?). Technically, for this particular case, I need a new Addon called "Block Fonts by Name, Family or Type" (one that would look at the font-family, right before rendering text)...but that doesn't exist yet.
Gingerbread Man wrote:...3 slow filters don't have any noticeable impact on performance.
...I didn't really think so, but that snail was snickering at me.

If possible, it would be a good idea if we could "profile" filters...have ABP keep track of "how long" each filter takes...to find out at what point snail (or any) filters DO actually cause a problem. I'm sure the profiling code would slow everything down more than the filters, but it would be nice to turn it on for a week to get some data.
User avatar
Gingerbread Man
Posts: 1339
Joined: Fri Aug 12, 2011 5:28 am

Re: Fix my slow/snail filters?

Post by Gingerbread Man »

"8 characters" is no longer accurate. As you can see in the above example, both foo and bar are just 3 characters.
Like I said, a lack of delimiter characters is what makes the filter slow. Put another way, trying to match a loose string in the middle of a URL is going to be slow. Trying to match elsewhere will not be slow (e.g. path, domain or subdomain, etc.) provided the string is at least 3 characters long.

You should be able to replace the first filter with ^News701_$font

If you want to keep the other two very broad, I don't see a way to optimize them. You can make them specific to Google Fonts, and split the second filter into 2 filters:
  • ||googleusercontent.com/*roman$font
  • ||googleusercontent.com/*serif$font
  • ||fonts.googleapis.com/*serif$stylesheet
There's Diagnostics for Adblock Plus, but I don't know if it has profiling.
en/development-builds#installation
Locked