Posted July 18, 2015
rtcvb32: Reminds me.. I wrote a quick little BASIC program to draw a circle since the graphics modes were simple and didn't require anything special to get going... And honestly floating point work (Especially SIN/COS/TAN) is SLLLOOOWWWW!, the largest speedups involved saving the results or re-using the SIN/COS results rather than re-calculating them. So a peep-hole optimizer might be useful, but better coding is going to get a much better result...
A peephole optimizer won't help with trigonometric functions; in fact, your best bet is to actually use more DATA statements and lookup tables for the results. Caching the results is basically like using "look-up" tables. :)
The peep-hole optimizer was an idea to look for things that were obvious and blatant duplication of effort, like maybe calling to "PRINT" 30 times without any variables when you could just concatenate all those strings into one PRINT statement, find a way to eliminate obvious IF/THEN/ELSE constructs, etc.
Sarisio: Hmmm, one of first things I saw was on this site was this. Sometimes I surprise myself by my ability to find strange stuff where others are just passing by...
I've actually seen it before distributed on a CD I once purchased for an Interactive Fiction collection...Post edited July 18, 2015 by JDelekto