Login
Back to forumSee the full topicGo to last reply

Posted By

Csabo
on 2017-02-13
09:44:58
 Re: BASIC Balloon Breaker

I pointed this out to Gaia in a PM, I didn't think it's worth cluttering the forum with it... But since you brought it up happy

First complaint: posting this huge screenshot is bad form, takes up too much space and can't be copy/pasted from.

Second: That's only half the reason (GOTO 60 is slower than GOTO 20 due to the number of lines before it), and you're still wrong. Your example suffers from a similar problem. As it is, the 2nd loop consistently takes about ~6180. However, if you run the two tests as two completely separate 3-line programs (as it should be), it consistently takes about ~6080. So you're unfairly adding about 100 to the speed. (I suspect it's because I% happens to be the 2nd variable that has been allocated, so it takes longer to find it, but don't quote me on that. My point still stands regardless of the cause.)

And finally, the other half of the problem is that the interpreter takes longer to parse the "I%" variable name than "I", since it's a whole byte longer. A more fair comparison would be "I1" vs. "I%", so both variable names are two characters/bytes.

The results are still the same in the end, the "%" variable is slower, but by less than both of your examples. Which is kinda weird, I also assumed that the integer variable would be faster, but not in this case.



Back to top


Copyright © Plus/4 World Team, 2001-2024