procmail
[Top] [All Lists]

Re: Scoring by size ???

2003-09-28 19:15:46
On Sun, 28 Sep 2003, Dallman Ross wrote:

One can and should also think about what the most likely missed
conditions are, and put them first-of-all.

All other things equal, this is true.  However, if you've got one really
hairy regular expression that misses a lot, and one really simple one that
misses only some of the time, you _might_ still be better off testing the
simple one before the hairy one.

So I'd try to order the recipe like so:

 :0
  *            ^Date:
  *           ^^From ()
  *            ^Received:
  *  200^0   ! ^From:
  *  100^0   ! ^Message-ID:
  { WE_ARE_HERE }

This does bring up a question, though, the answer to which I don't know:
Since From_ is always above Date:, are we making procmail do extra work
by starting with a test of Date: and then moving "upstream" to From_?

Adding to what David T. said:  You're only making procmail do extra work
in the case where Date: is present but From_ is not, which you believe is
an unlikely circumstance.  On the other hand, checking for five characters
anchored at the start of the search buffer is going to be so fast that I
think you might as well put the ^^From test first anyway.


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>