loveleeyoungae wrote:1. Should I use one regex
or two simple filters
The standard recommendation is simple filters. You should base your list on as many simple filters as possible as long as you can avoid regexps in my opinion.
If you look at this graph:
http://adblockplus.org/images/43.gif
The red line represents regexp performance and general filter performance from ancient Adblock versions.
Ignore the green line. The current ABP version is represented by the blue line if I recall correctly.
So, 100 regexps are considerably slower than 100 simple filters.
Then look at this graph:
http://adblockplus.org/images/44.gif
The difference between 100 simple filters and 3000 simple filters is almost 0. But can you imagine how slow the red line would be at 3000 filters?
Wladimir wrote the article about performance here:
http://adblockplus.org/blog/investigati ... algorithms
With this in mind, I recommend you to use simple filters as crazily as you want.
loveleeyoungae wrote:/quangcao
/qcao
To get more in depth.
/quangcao is a fast simple filter, while
/qcao is as slow as regexps.
To be a fast filter, you need to have 8 unbroken characters in a row. Filters that start
and end with the
/ mark is regexp, so
/example-ads/ is slow while
*/example-ads/* is fast.
I'll give you a few more examples:
http://ai.pricegrabber.com/*
12345678
*
.imageshack.us/comments.js*
/advertpro/
*
The 4 above filters are fast.
/advertpro
/
12345
*67890
/12345678
/
*ads*
*/ads/*
The 5 above filters are slow as regexps.
So with these rules,
/qcao is slow like regexp, if you can make the filter longer then it'll become fast, otherwise it won't hurt too much as long as you only have a few.
If you have many small/slow filters like
/qcao, then you have the option to combine them into complex regexps of course, there will be advantage and disadvantages.
Huge, complex regexps appears to be faster than many small regexps, but at the same time they are harder to maintain. And it's harder to debug false positives. Furthermore your users lose flexibility to disable the individual regexps.
So there's advantage and disadvantage so the choice is yours.
loveleeyoungae wrote:When I added the filter #div(id^=divAd), it didn't list that ad as a blockable item in the blockable items list.
It is not displayed due to a bug. There is a workaround if you want to display it in the blockable items list.
1. go to the site.
2. open blockable items list.
3. open ABP preferences menu.
4. Click ok to close the preferences menu.
After this it should display your element rules, this method works for the latest stable version.
loveleeyoungae wrote:Then was that ad still downloaded?
Yes. All rules that look similar to #div(id^=divAd) or domain.com#div and so on do not block downloads, they only hide the ads.
loveleeyoungae wrote:Is there any better way to block ads on this page? I want to permantly block them from being downloaded.
Block it the normal way:
http://adblockplus.org/en/faq_basics#objects
loveleeyoungae wrote:should I add the filter /VAImages or only need to filter some script?
Because I think there is a script which loads all ads on this page
You would need to experiment and test yourself, sometimes scripts have other important things in them and not just ads.
loveleeyoungae wrote:and if I block that only script then ABP wouldn't have to block every address containing /VAImages?
True, if you find a script that only loads ads, then the best way is to kill the script.