The Adblock Project Forum Index The Adblock Project
Pull up a seat ...stay a while.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Which filter is more efficient?

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    The Adblock Project Forum Index -> Main
View previous topic :: View next topic  
Author Message
AmirG



Joined: 26 Mar 2005
Posts: 119

PostPosted: Sat May 07, 2005    Post subject: Which filter is more efficient? Reply with quote

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
View user's profile Send private message
mcm_ham



Joined: 17 Dec 2004
Posts: 310

PostPosted: Sat May 07, 2005    Post subject: Reply with quote

http://aasted.org/adblock/viewtopic.php?t=1626
Back to top
View user's profile Send private message Visit poster's website
AmirG



Joined: 26 Mar 2005
Posts: 119

PostPosted: Sat May 07, 2005    Post subject: Reply with quote

So I should've been searching for "speed" instead of "efficien*"? Smile

Thanks, but that thread doesn't really answer my questions, it only made me confused.
Back to top
View user's profile Send private message
DEFIANT



Joined: 12 Sep 2004
Posts: 6

PostPosted: Sun May 08, 2005    Post subject: Reply with quote

http://www.geocities.com/pierceive/adblock/
_________________
E=mc˛
The Ur-Quan Masters
Back to top
View user's profile Send private message
AmirG



Joined: 26 Mar 2005
Posts: 119

PostPosted: Sun May 08, 2005    Post subject: Reply with quote

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
View user's profile Send private message
Guest






PostPosted: Tue May 10, 2005    Post subject: Reply with quote

A good idea to detect the better filters

http://aasted.org/adblock/viewtopic.php?t=1925
Back to top
AmirG



Joined: 26 Mar 2005
Posts: 119

PostPosted: Tue May 10, 2005    Post subject: Reply with quote

And that also wasn't what I was asking about, but that thread is quite interesting, so thanks anyway.
Back to top
View user's profile Send private message
wonkothesane
The Other Developer


Joined: 22 May 2004
Posts: 210

PostPosted: Wed May 11, 2005    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address
AmirG



Joined: 26 Mar 2005
Posts: 119

PostPosted: Wed May 11, 2005    Post subject: Reply with quote

Thanks.

Just one more question: does shortening includes concatenating several filters together, eg. combining "/abc/" and "/xyz/" to "/(abc|xyz)/"?
Back to top
View user's profile Send private message
kstahl
Support


Joined: 02 Jan 2004
Posts: 1202
Location: Stockholm, Sweden

PostPosted: Thu May 12, 2005    Post subject: Reply with quote

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.Cool Gecko/20051111 Firefox/1.5
Back to top
View user's profile Send private message
AmirG



Joined: 26 Mar 2005
Posts: 119

PostPosted: Thu May 12, 2005    Post subject: Reply with quote

So it doesn't really matter. Thanks again.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    The Adblock Project Forum Index -> Main All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group