What I suggest you do is compile the program with the assembly option and
look at the code generated.

In the case that something will ALWAYS be equal or not equal, why bother to
test?

But going with your conditions. If you put the know condition first, then
one that satisfies the test, then yes it should perform better.



On Wed, Jul 17, 2013 at 10:29 AM, K <kzafi...@gmail.com> 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 lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>



-- 
The postings on this site are my own and don’t necessarily represent
Mainline’s positions or opinions

Mark D Pace
Senior Systems Engineer
Mainline Information Systems

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to