VPOKE() vs PRINT

Страница 2/2
1 |

By Underscore

Rookie (22)

Аватар пользователя Underscore

09-11-2019, 13:21

jltursan wrote:

And if you join the three lines, FOR, VPOKE & NEXT in the same line you can get the last optimization. No idea if it'll be noticeable but worth trying it

Removing all spaces and using 1-line for...next loop for the three methods, I got:

vpoke = from 119 to 115 cycles
print = from 107 to 102 cycles
out = from 107 to 101 cycles

code be like:

Just changing print"" for each method.

Any other possible optimization or method?

By theNestruo

Champion (430)

Аватар пользователя theNestruo

09-11-2019, 13:21

Acutally, removing the parenthesis around I makes it faster: VPOKEI is faster than VPOKE(I) because the time taken to evaluate I is smaller than to evaluate (I).

My attempt(s):

1T=TIME:SCREEN1:DEFINTI:Z$=STRING$(192,"A"):PRINTZ$;Z$;Z$;Z$;:PRINTTIME-T
1T=TIME:SCREEN1:DEFINTI:DEFSTRZ:Z=STRING$(192,"A"):PRINTZ;Z;Z;Z;:PRINTTIME-T
Страница 2/2
1 |