You need to keep two things in mind.  Even very simple optimizers 1)
break off evaluation with the outcome  FALSE as soon as an AND
component is found to be false, and 2) break off evaluation with the
outcome true as soon as an OR component is found to be true.

Thus trhe components bi of

a = b1 | b2 | b3 |...|bn

should be arranged in descending probability seq

Your second example gets things backwards

On 7/17/13, K <[email protected]> wrote:
> Dear all
>
> I would like to tune some IF THEN ELSE statements by changing operands
> positions of OR & AND statements in some of my COBOL II v3.4 programs.
>
> Can we say that if always VAR1 assigned to VALUE1 the following statement
> (VAR1 EQUAL 'VALUE1') OR (VAR2 EQUAL 'VALUE2)
> has better performance than
> (VAR2 EQUAL 'VALUE2) OR (VAR1 EQUAL 'VALUE1') ?
>
> In a similar way, can we say that if always VAR1 is not equal to VALUE1 the
> following statement
> (VAR2 EQUAL 'VALUE2) AND (VAR1 EQUAL 'VALUE1')
> has better performance than
> (VAR1 EQUAL 'VALUE1') AND (VAR2 EQUAL 'VALUE2)  ?
>
> Kind regards
> Kostas
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>


-- 
John Gilmore, Ashland, MA 01721 - USA

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to