[Top] [All Lists]

Re: evaluating tests when the result makes no sense

2008-11-30 05:13:28

Philip Guenther writes:
On Sat, 29 Nov 2008, Arnt Gulbrandsen wrote:
Further, and perhaps more seriously, I don't see any requirement of order. As far as I can see, a sieve implementation can evalue header and envelope in either order in this case:

An implementation can do that only if the 'variables' extensions has not been required. The variables spec, RFC 5229, says this in section 3.2: The interpreter MUST short-circuit tests, i.e., not perform more tests than necessary to find the result. Evaluation order MUST be left to right. If a test has two or more list arguments, the implementation is free to choose which to iterate over first.


I had a vague intention of someday doing just that... "apply sieve script to all old mail", which would transmogrify the sieve script into a series of rather complex SQL queries and shuffle mail around from where it is to where the sieve script would have filed it. That would, among other things, make the RDBMS query planner choose evaluation order based on expected performance, and probably make the whole operation faster by a few orders of magnitude.


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