Don't have an account? Register now to chat, post, use our tools, and much more.
Latest Headlines
Online Users
There are 67 users online: 1 member, 40 guests and 26 bots. Members: JosJuice. Bots: VoilaBot (1), MSN/Bing (1), Magpie Crawler (3), VoilaBot (4), Yahoo! Slurp (1), Googlebot (15), MSN/Bing (1).
RSS & Social Media
SAX
You must log in to view the SAX chat widget
|
| Author |
Message |
|
LuxenD

Advanced Member

Joined: 12 Sep 2012 Posts: 299 Location: Late for Supper...
|
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? _________________ Locked On and Ready to Fire!!!
Projects:
TMFlower{♠♠---}
Whiteboard{-----} |
|
| Back to top |
|
|
elfprince13

OVER NINE THOUSAND!

Joined: 23 May 2005 Posts: 10234 Location: A galaxy far far away......
|
|
| Back to top |
|
|
LuxenD

Advanced Member

Joined: 12 Sep 2012 Posts: 299 Location: Late for Supper...
|
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. _________________ Locked On and Ready to Fire!!!
Projects:
TMFlower{♠♠---}
Whiteboard{-----} |
|
| Back to top |
|
|
KermMartian

Site Admin

Joined: 14 Mar 2005 Posts: 55773 Location: Earth, Sol, Milky Way
|
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: 8189
|
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

Retired TI-83+ coder

Joined: 18 Mar 2005 Posts: 1487 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 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)
Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter |
|
| Back to top |
|
|
cvsoft

New Member

Joined: 03 Aug 2012 Posts: 93 Location: California, USA
|
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: 55773 Location: Earth, Sol, Milky Way
|
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 |
|
|
techboy6601

Member

Joined: 31 Jan 2012 Posts: 124
|
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 |
|
|
|
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
|
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-2013 Cemetech & Kerm Martian :: Page Execution Time: 0.028432 seconds.
|