04-06-2004, 05:00 PM
I c. :*)
:oops:
:oops:
What is faster/most efficient (speed wise) IF or CASE
|
04-06-2004, 05:00 PM
I c. :*)
:oops:
04-06-2004, 11:15 PM
I think this will make it even faster.
Code: qbasicSUB foo() I noticed an increase in speed in my program =P
04-07-2004, 12:25 AM
Yup, always exiting as soon as done.
I know GOTO is a nono, but I wonder if it wouldn't be possible to gain even more speed by using it. This is how I have it setup right now: Code: qbasicSUB bla () I wonder if it would be faster like this: Code: qbasicSUB bla () Is goto faster then calling a sub?
04-07-2004, 01:26 AM
Definitely goto is faster than calling a SUB because when you call a SUB there are overheads involved where as GOTO doesnt involve that many overheads.
04-07-2004, 04:05 AM
GOTO is great for speed. And you are an experienced programmer, so GOTO is not a no-no for you.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio underBASIC, homegrown musicians [img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
04-07-2004, 06:40 AM
Quote:Yup, always exiting as soon as done. Hey Zire, I agree with Nate (Although I argue with Aga against the virtues of goto)...Goto is a good tool for making a clean exit from a nested loop structure. In your example, I don't think goto should help, because, since the first condition was true, the elsif should behave in the same manner as your goto. I rarely use it, but like the goto for this structure... Code: do '<---My post has a "do" here!!! rather than: Code: do '<--My post has a "do" here Edit: EEEKKKK!!!!!!!!! That damn code highlighter is messing with my post....again....can somebody turn that *feature* off???!!!...ok...I removed the "code" flags...to get the code to appear a little bit better... |
« Next Oldest | Next Newest »
|