View previous topic :: View next topic |
Author |
Message |
AmirG
Joined: 26 Mar 2005 Posts: 119
|
Posted: Sat May 07, 2005 Post subject: Which filter is more efficient? |
|
|
With my Firefox getting noticeably slower, I thought I'd try to optimize my Adblock filterset. For this I need to know which filters are more efficient.
Would a simple filter, e.g. "http://abc.com/*", be more efficient than it's regex equivalent, "/http:\/\/abc\.com\/"? How about "/\/abc\.com\/"?
Which filterset is more efficient, "http://*abc.com/*", "http://abc.com/*" and "http://www.abc.com/*" or "/\/(www.)?abc\.com\//"?
The regex "/abc(de|fg)/" is obviously more efficient than "/abcde/" and "/abcfg/", but is there any performance difference between "/(tu|vw)xyz/" and the pair of "/tuxyz/" and "/vwxyz/"? |
|
Back to top |
|
 |
mcm_ham

Joined: 17 Dec 2004 Posts: 310
|
|
Back to top |
|
 |
AmirG
Joined: 26 Mar 2005 Posts: 119
|
Posted: Sat May 07, 2005 Post subject: |
|
|
So I should've been searching for "speed" instead of "efficien*"?
Thanks, but that thread doesn't really answer my questions, it only made me confused. |
|
Back to top |
|
 |
DEFIANT

Joined: 12 Sep 2004 Posts: 6
|
|
Back to top |
|
 |
AmirG
Joined: 26 Mar 2005 Posts: 119
|
Posted: Sun May 08, 2005 Post subject: |
|
|
Thanks, but that's not what I was asking for. I have my own filterset that is suitable for the sites I visit and is much shorter than filterset G. I want to make my filterset more efficient, not more effective. |
|
Back to top |
|
 |
Guest
|
|
Back to top |
|
 |
AmirG
Joined: 26 Mar 2005 Posts: 119
|
Posted: Tue May 10, 2005 Post subject: |
|
|
And that also wasn't what I was asking about, but that thread is quite interesting, so thanks anyway. |
|
Back to top |
|
 |
wonkothesane The Other Developer
Joined: 22 May 2004 Posts: 210
|
Posted: Wed May 11, 2005 Post subject: |
|
|
AmirG:
When matching against strings of lengths commonly found for URLs (e.g. less than 200 characters), compiled regular expressions are ever-so-slightly faster than "simple filters", at least in 0.5.
However, the impact any given filter's syntax is far outweighed by the extra code Adblock has to execute to match the filter at all. That is to say, shortening your filterlist may give you a speed boost, whereas switching between "abc.com/" and "/http://abc.com/" will not. |
|
Back to top |
|
 |
AmirG
Joined: 26 Mar 2005 Posts: 119
|
Posted: Wed May 11, 2005 Post subject: |
|
|
Thanks.
Just one more question: does shortening includes concatenating several filters together, eg. combining "/abc/" and "/xyz/" to "/(abc|xyz)/"? |
|
Back to top |
|
 |
kstahl Support
Joined: 02 Jan 2004 Posts: 1202 Location: Stockholm, Sweden
|
Posted: Thu May 12, 2005 Post subject: |
|
|
Yes, in theory. Unless you have a very long list I doubt you will see any real difference in practice though. _________________ Adblock 0.5.3.042
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1. Gecko/20051111 Firefox/1.5 |
|
Back to top |
|
 |
AmirG
Joined: 26 Mar 2005 Posts: 119
|
Posted: Thu May 12, 2005 Post subject: |
|
|
So it doesn't really matter. Thanks again. |
|
Back to top |
|
 |
|