Jump to content

New demo uploaded: Proteus


Recommended Posts

Proteus

View File

This is a single program listing that contains three different versions of the Proteus Demo from my thread in HOWTOs on converting and optimizing BASIC programs.   

Version .02  was from very early in the conversion/optimization process from that thread and, consequently, is quite slow.   Its also got the original author's bad scaling coefficients, which make the output look a little gnarly.   

Version 1.0 was originally what I thought would be the 'fully optimized' version, with all sorts of things (documented in the thread) done to squeeze out better performance.   And of course the scaling is fixed so the output looks better.   This was supposed to be the end of the thread, except that... 

Version 2.0 takes advantage of something I noticed about the calculations, which led to the idea to have the program start off by precomputing a table that allows us to avoid having BASIC redundantly performing a bunch of the most expensive operations in the program.   Even considering (and counting) the over minute-and-a-half it takes to initially compute the lookup table, the trick resulted in nearly halving the time to complete plotting the output compared to what was the previous fastest version.   (Of course, I now wonder if some of the better math and coding gurus have been rolling their eyes all along, just wondering when, if ever, I might figure this part out...).     

Just RUN it and pick A, B or C from the menu.    When its done plotting and puts up the elapsed time (its in HHMMSS format) you can press any key, and it will 'LIST' the program lines that correspond to the version that just completed plotting. 

I hope folks find it helpful having the three versions (and the howto thread) in terms of seeing how the thing evolved.  You will notice that the more tweaking you do for speed, the more opaque and confusing the program becomes in terms of ever expecting someone with fresh eyes to try and see what the heck is going on.   That 'early' version is included, in part, because its much easier to follow than the others. 

More info at the thread here:   

 


 

  • Like 3
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

Please review our Terms of Use