UBASIC Speed Hints
A loop containing
if Inbyte<>I then ....
Took 219 ms
where a loop containing
If Inbyte=I then....
Took 31 ms, or about 7 times faster.
If the sub is small, your program may run significantly faster if the code is in the main body rather using the subroutine, especially if sub is called many times.
On a 486DX/4 75 MHz:
Runs in 65% of the time it takes this:
Using Hex instead of decimal values slowed it down slightly.
BUT, Out base%,0 tested 4% faster than Out 956,0. Four percent may not seem like much, but multiply that by the number of times it is used, and the number of nodes installed.
CLR A is faster than A = 0.
DEC A is faster than A = A - 1.
ENCODE(string) makes VAL faster.
INC A is faster than A = A + 1.
NEG A is equivalent to A = -A, but faster.