Re: TIB: program speed


[Prev][Next][Index][Thread]

Re: TIB: program speed




On Thu, 29 Jan 1998 22:43:07 -0600 "Matthew" <mobets@flash.net> writes:
[snip]
>Did you really use X in the for statement AND in the "X+1/->/X"?
>If so, your times are wrong!

oops!  Thanks, I knew something was wrong.
The true/false times _should_ have been
the same, now they are.
----------------------------------------------
     :0->A                      :0->A
     :For(X,1,100               :For(X,1,100
2.4s :If A>100             2.4s :If A<100
     :A+1->A                    :A+1->A
     :End                       :End

     :0->A                      :0->A
     :For(X,1,100               :For(X,1,100
1.6s :A+(A>100->A          1.6s :A+(A<100->A
     :End                       :End

But here's something interesting:
     :0->A                      :0->A
     :For(X,1,100               :For(X,1,100
1.7s :If A>100:Then        2.8s :If A<100:Then
     :A+1->A                    :A+1->A
     :End:End                   :End:End
----------------------------------------------

The always false if/then/end code is almost
the fastest, but doesn't compensate for when
the code is true(the entire purpose of the
statement).  Therefore, the then/end should
only be used when no better option is available.


Sincerely,
The Unibomer

Jared Ivey
Unibomer@Juno.com
http://www.geocities.com/SiliconValley/Vista/7342

"There comes a time in the affairs of man when he must take the bull by
the tail and face the situation" -- W. C. Fields


_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]


References: