discussing the slowness of Basic and other things over SAX one afternoon, i had an epiffany! What if you could get a small speed boost by not modifying codesn for speed?

Instead of this...


output(1,1,"hello thar

...use this


output(1,1,"hello thar")

this might just be a small change, but what if the ti-os basic interpreter spends time judging, then fixing, code optimisations such as these, could it be that speedwise these are not optimisations at all?
well, so it does. thanks elfprince.

now that is settled, it's likely that the tios is still performing small checks to see if those optimisations still exist. so, say you were to install a hook on running a program that youve modified for strict (what im calling unoptimized code).
you could have the hook skip those check codes, to speed up the program a little bit more.
Well, either way it checks if the next character is another operator or operand, or the start of a new command, so there's no way to optimize the parser further. For example, if you read L1(A, there's no way to know if you'll get a newline next, or a +1, or a )+1, or anything else.
It's not checking for these optimizations, though - it's just using the newline character as a hard terminate for any open groupings.
I think the biggest case of slowdown due to omitting ) is false If instrunctions in For( loops, seen in elf's link.

Also I think that one caused a permanent slowdown in some cases, although that was probably due to me using ASM libs or having a very large amount of sub-programs and low amount of RAM and archive. I had that happen when making Illusiat 13 and the slowdown would go away when pressing ON.

:Disp checkTmr(X

With the Output( closed, it takes 1 second longer. I did multiple trials to eliminate clock error; 61 seconds with closing "), 60 without. It seems faster without, but hardly.
CVSoft, indeed; the biggest savings is the space savings from omitted closing characters. As you pointed out, though, and as I and Kllrnohj explained, it would be no faster to assume the optimizations were in place (nor in fact feasible).
I can see what you mean, but I'm afraid your wrong, as has been said before. Although, even if these checks were in place, you probably wouldn't even notice the change unless you were doing some really freaky stuff.

All things considered, omitting these characters helps not only in space saving but also increasing speed.
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum