CEMETECH
Leading The Way To The Future
Login [Register]
Username:
Password:
Autologin:

Don't have an account? Register now to chat, post, use our tools, and much more.
Latest Headlines
Online Users
There are 90 users online: 8 members, 70 guests and 12 bots.
Members: blackhawk, gaventemples31415, HOMER-16, musicallseoul, tfromme.
Bots: VoilaBot (5), MSN/Bing (1), Magpie Crawler (3), Googlebot (2), MSN/Bing (1).
RSS & Social Media
SAX
You must log in to view the SAX chat widget
Author Message
Luxen


Power User


Joined: 12 Sep 2012
Posts: 495

Posted: 13 Nov 2012 01:23:20 pm    Post subject: Strict Basic to speed up calcs?

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...

Code:

output(1,1,"hello thar


...use this

Code:

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?
_________________
psalms 119:90 - what legacy are you leaving?
Want to give me an Internet? Click here!

My Current Projects
Back to top
elfprince13


OVER NINE THOUSAND!


Joined: 23 May 2005
Posts: 10736
Location: A galaxy far far away......

Posted: 13 Nov 2012 01:35:50 pm    Post subject:

http://tibasicdev.wikidot.com/timings#toc13
_________________
StickFigure Graphic Productions || VSHI: Vermont Sustainable Heating Initiative


Back to top
Luxen


Power User


Joined: 12 Sep 2012
Posts: 495

Posted: 13 Nov 2012 02:47:05 pm    Post subject:

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.
_________________
psalms 119:90 - what legacy are you leaving?
Want to give me an Internet? Click here!

My Current Projects
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 58240

Posted: 13 Nov 2012 10:54:07 pm    Post subject:

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.
_________________


Back to top
Kllrnohj


/=\ PH34R |\/|3


Joined: 24 May 2005
Posts: 8197

Posted: 14 Nov 2012 11:22:29 pm    Post subject:

It's not checking for these optimizations, though - it's just using the newline character as a hard terminate for any open groupings.
_________________
There are only two kinds of programming languages: those people always bitch about and those nobody uses. (Bjarne Stroustrup)
Back to top
DJ_O


Former Omnimaga admin


Joined: 18 Mar 2005
Posts: 1729
Location: Quebec (Canada)

Posted: 14 Nov 2012 11:44:46 pm    Post subject:

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.
_________________
Retired Omnimaga/TIMGUL founder ►PM Omni issues to Omni admins not me, else I won't reply◄

Bandcamp|FB|Youtube|Twitter
Back to top
CVSoft


Member


Joined: 03 Aug 2012
Posts: 168

Posted: 15 Nov 2012 12:06:51 am    Post subject:


Code:
PROGRAM:AAAAAAA
:startTmr→X
:For(A,1,9001
:Output(1,1,"ABCDE
:End
: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.
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 58240

Posted: 15 Nov 2012 12:45:29 am    Post subject:

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).
_________________


Back to top
Nexuist


Member


Joined: 31 Jan 2012
Posts: 126

Posted: 16 Nov 2012 06:52:01 pm    Post subject:

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.
_________________
My graphics card is a crayon box.





Back to top
Display posts from previous:   
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
   
View previous topic :: View next topic  
Page 1 of 1 All times are GMT - 5 Hours

 
Jump to:  
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

© Copyright 2000-2014 Cemetech & Kerm Martian :: Page Execution Time: 0.032559 seconds.