Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
20 May, 2013, 10:14:47 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1] 2   Go Down
  Print  
Author Topic: Speed -  (Read 1545 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
BlakPilar
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: 20 February, 2013, 02:38:22
Date Registered: 16 July, 2011, 02:50:55
Posts: 735


Topic starter
Total Post Ratings: +43

View Profile
« on: 19 July, 2011, 05:40:39 »
0

I'm writing my first major Axe program and I noticed that the speed isn't much faster than BASIC. Is this because my TI-84+ is too old? Sad
Logged
Eeems
THE GAME
Administrator
LV13 Extreme Addict (Next: 9001)
*
Offline Offline

Gender: Male
Last Login: Today at 05:48:24
Date Registered: 14 March, 2009, 03:32:57
Location: Edmonton, Alberta
Posts: 5072


Total Post Ratings: +230

View Profile WWW
« Reply #1 on: 19 July, 2011, 05:43:25 »
0

I'm writing my first major Axe program and I noticed that the speed isn't much faster than BASIC. Is this because my TI-84+ is too old? Sad
No it must be the way you are formatting your code. A 84+ runs at ~15MHz no matter how old it is.
Maybe post your code somewhere and people can help you optimize it to make it run faster.
Logged

mrmprog
LV7 Elite (Next: 700)
*******
Offline Offline

Last Login: 28 September, 2012, 05:58:25
Date Registered: 15 February, 2011, 01:35:36
Location: Somewhere
Posts: 559


Total Post Ratings: +34

View Profile
« Reply #2 on: 19 July, 2011, 05:50:14 »
0

I am actually having a similar problem. What is the command to set 15mhz mode, is it FULL?
Logged

Darl181
Vy'o'us pleorsdtu tlh'e gjaemue.
Coder Of Tomorrow
LV12 Extreme Poster (Next: 5000)
*
Online Online

Gender: Male
Last Login: Today at 10:13:14
Date Registered: 10 June, 2010, 00:32:08
Location: {I*9+L₁+1},{I*9+L₁+3}
Posts: 3272


Total Post Ratings: +267

View Profile WWW
« Reply #3 on: 19 July, 2011, 06:01:50 »
0

Yes it is.  Like eeems said, your code will only be fast if it's coded well.
« Last Edit: 19 July, 2011, 06:02:04 by Darl181 » Logged




 
Spoiler for Stuff:



OS 2.43  Boot 1.02  Hardware Rev. B

OS 1.04.32

OS 3.1.0.392  Boot1 3.0.99  Boot2 3.10.16
Spoiler for Misc:
Quote
You'll understand / It's not a shame / To be always / Losing the game / Burma-Shave
"Dynamic userbars!"
Omnimaga radio
Interactive Omnimaga radio
Our World of Text
Draw on websites
Then blow them up
In-browser flight simulator
Haxball: MMO soccer/air hockey game
  Draw with sand.  Yay?
The Game
You just lost the game
Zombo.com
light post color is #dfefff
dark post color is #cae4ff
quote box color is #6699ff
transparent color is...transparent 0.o
Spoiler for Forum search alternative (bookmarklet):
https://www.squarefree.com/bookmarklets/search.html
javascript:q=""+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);if(!q)q=prompt("No%20selected%20text;%20enter%20search%20term.").replace(/\s\+/g,"%252B");if(q!=null)location="http://www.google.com/search?q="+q.replace(/\s+/g,"+")+"+site:"+location.hostname;void(0);
BlakPilar
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: 20 February, 2013, 02:38:22
Date Registered: 16 July, 2011, 02:50:55
Posts: 735


Topic starter
Total Post Ratings: +43

View Profile
« Reply #4 on: 19 July, 2011, 06:02:48 »
0

Nevermind! I did it, thanks anyway guys! I was storing getKey to a variable, which I'm guessing is a no-no in Axe. Maybe that's your problem too, mrmprog?
« Last Edit: 19 July, 2011, 06:07:15 by BlakPilar » Logged
JustCause
Coder Of Tomorrow
LV8 Addict (Next: 1000)
*
Offline Offline

Gender: Male
Last Login: 14 March, 2013, 00:30:22
Date Registered: 28 April, 2010, 19:35:41
Posts: 734


Total Post Ratings: +108

View Profile
« Reply #5 on: 19 July, 2011, 06:30:46 »
0

Nevermind! I did it, thanks anyway guys! I was storing getKey to a variable, which I'm guessing is a no-no in Axe. Maybe that's your problem too, mrmprog?

This really shouldn't be a problem. In fact, I'd go as far as saying it's not the problem. getKey->K is perfectly legitimate code.
« Last Edit: 19 July, 2011, 06:31:04 by JustCause » Logged

leafy
Coder Of Tomorrow
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: 17 May, 2013, 00:26:27
Date Registered: 26 December, 2010, 05:27:03
Location: the ninth circle of hell
Posts: 1545


Total Post Ratings: +371

View Profile WWW
« Reply #6 on: 19 July, 2011, 06:31:57 »
0

Well if you're doing something like (I'm only saying this because I did it before, because it's perfectly acceptable in TI-BASIC)

If getKey=54
Goto FCK
End
If getKey=9
Goto WTF
End

and so on it can massively slow down.
Logged

In-progress: Blastlabs, TMJO, qb?, VVVVVV?
Finished: Tag, Tap, MFQT, Nyan
Dead: Graviter
BlakPilar
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: 20 February, 2013, 02:38:22
Date Registered: 16 July, 2011, 02:50:55
Posts: 735


Topic starter
Total Post Ratings: +43

View Profile
« Reply #7 on: 19 July, 2011, 06:46:35 »
0

Hmm... Well, here was my original code:

1
2
3
4
5
Repeat getKey(15)
getKey->K
X-(K=...)+(K=...)->X
Y-(K=...)+(K=...)->Y
That ran almost at the same speed as BASIC. My new code is the same, but I don't store getKey to K and instead of (K=...), I use (getKey(...)). Now it runs extremely fast. Huh?
« Last Edit: 19 July, 2011, 06:48:03 by BlakPilar » Logged
JustCause
Coder Of Tomorrow
LV8 Addict (Next: 1000)
*
Offline Offline

Gender: Male
Last Login: 14 March, 2013, 00:30:22
Date Registered: 28 April, 2010, 19:35:41
Posts: 734


Total Post Ratings: +108

View Profile
« Reply #8 on: 19 July, 2011, 06:51:08 »
0

Hmm... Well, here was my original code:

1
2
3
4
5
Repeat getKey(15)
getKey->K
X-(K=...)+(K=...)->X
Y-(K=...)+(K=...)->Y
That ran almost at the same speed as BASIC. My new code is the same, but I don't store getKey to K and instead of (K=...), I use (getKey(...)). Now it runs extremely fast. Huh?

Then your issue was probably key debouncing. Direct input [getKey(xx)] will fire every frame. getKey->K and testing K will fire every few frames because of the way that input routine works...if I recall correctly. Don't quote me on that, tho.

Regardless, getKey->K and testing K shouldn't be itself particularly slower than getKey(K). That is to say, the instructions shouldn't take much longer.
« Last Edit: 19 July, 2011, 06:51:48 by JustCause » Logged

DrDnar
LV6 Super Member (Next: 500)
******
Offline Offline

Last Login: Today at 07:08:28
Date Registered: 29 October, 2010, 00:08:46
Posts: 459

Total Post Ratings: +76

View Profile
« Reply #9 on: 19 July, 2011, 06:59:08 »
0

I'm writing my first major Axe program and I noticed that the speed isn't much faster than BASIC. Is this because my TI-84+ is too old? Sad
No it must be the way you are formatting your code. A 84+ runs at ~15MHz no matter how old it is.
Maybe
Er, no. The EOS kindly automatically reduces the CPU speed to 6 MHz before running assembly programs and applications so that any timing code runs the same. You're expected to explicitly set the CPU speed if you want to run at full speed. However, BASIC programs automatically run in fast mode.
Logged

"The tools which would teach men their own use would be beyond price."—The Republic
BlakPilar
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: 20 February, 2013, 02:38:22
Date Registered: 16 July, 2011, 02:50:55
Posts: 735


Topic starter
Total Post Ratings: +43

View Profile
« Reply #10 on: 19 July, 2011, 07:03:01 »
0

Hmm... Well, here was my original code:

1
2
3
4
5
Repeat getKey(15)
getKey->K
X-(K=...)+(K=...)->X
Y-(K=...)+(K=...)->Y
That ran almost at the same speed as BASIC. My new code is the same, but I don't store getKey to K and instead of (K=...), I use (getKey(...)). Now it runs extremely fast. Huh?

Then your issue was probably key debouncing. Direct input [getKey(xx)] will fire every frame. getKey->K and testing K will fire every few frames because of the way that input routine works...if I recall correctly. Don't quote me on that, tho.

Regardless, getKey->K and testing K shouldn't be itself particularly slower than getKey(K). That is to say, the instructions shouldn't take much longer.
Wait... Could it possibly be different or help to know that I'm using sprites, not just a single pixel?
Logged
JustCause
Coder Of Tomorrow
LV8 Addict (Next: 1000)
*
Offline Offline

Gender: Male
Last Login: 14 March, 2013, 00:30:22
Date Registered: 28 April, 2010, 19:35:41
Posts: 734


Total Post Ratings: +108

View Profile
« Reply #11 on: 19 July, 2011, 07:06:38 »
0

Hmm... Well, here was my original code:

1
2
3
4
5
Repeat getKey(15)
getKey->K
X-(K=...)+(K=...)->X
Y-(K=...)+(K=...)->Y
That ran almost at the same speed as BASIC. My new code is the same, but I don't store getKey to K and instead of (K=...), I use (getKey(...)). Now it runs extremely fast. Huh?

Then your issue was probably key debouncing. Direct input [getKey(xx)] will fire every frame. getKey->K and testing K will fire every few frames because of the way that input routine works...if I recall correctly. Don't quote me on that, tho.

Regardless, getKey->K and testing K shouldn't be itself particularly slower than getKey(K). That is to say, the instructions shouldn't take much longer.
Wait... Could it possibly be different or help to know that I'm using sprites, not just a single pixel?
Maybe I should clarify. Direct input goes off every frame. Testing getKey->K does not. This means that, if you're updating the position of ANYTHING, be it sprite, character or pixel, that thing will move every few frames if you're using getKey->K, and every frame if you're using direct input. I'm about 80% sure I know what I'm talking about. Tongue
« Last Edit: 19 July, 2011, 07:06:49 by JustCause » Logged

Darl181
Vy'o'us pleorsdtu tlh'e gjaemue.
Coder Of Tomorrow
LV12 Extreme Poster (Next: 5000)
*
Online Online

Gender: Male
Last Login: Today at 10:13:14
Date Registered: 10 June, 2010, 00:32:08
Location: {I*9+L₁+1},{I*9+L₁+3}
Posts: 3272


Total Post Ratings: +267

View Profile WWW
« Reply #12 on: 19 July, 2011, 07:06:54 »
0

Just as a tip, you don't have to store getkey to a var unless you want to save it.  Something like X+(getKey(3))-(getKey(2))→X is valid as well Wink

inb4 someone pops up with some hyper-optimized routine... Tongue
« Last Edit: 19 July, 2011, 07:07:06 by Darl181 » Logged




 
Spoiler for Stuff:



OS 2.43  Boot 1.02  Hardware Rev. B

OS 1.04.32

OS 3.1.0.392  Boot1 3.0.99  Boot2 3.10.16
Spoiler for Misc:
Quote
You'll understand / It's not a shame / To be always / Losing the game / Burma-Shave
"Dynamic userbars!"
Omnimaga radio
Interactive Omnimaga radio
Our World of Text
Draw on websites
Then blow them up
In-browser flight simulator
Haxball: MMO soccer/air hockey game
  Draw with sand.  Yay?
The Game
You just lost the game
Zombo.com
light post color is #dfefff
dark post color is #cae4ff
quote box color is #6699ff
transparent color is...transparent 0.o
Spoiler for Forum search alternative (bookmarklet):
https://www.squarefree.com/bookmarklets/search.html
javascript:q=""+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);if(!q)q=prompt("No%20selected%20text;%20enter%20search%20term.").replace(/\s\+/g,"%252B");if(q!=null)location="http://www.google.com/search?q="+q.replace(/\s+/g,"+")+"+site:"+location.hostname;void(0);
BlakPilar
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: 20 February, 2013, 02:38:22
Date Registered: 16 July, 2011, 02:50:55
Posts: 735


Topic starter
Total Post Ratings: +43

View Profile
« Reply #13 on: 19 July, 2011, 07:09:44 »
0

Maybe I should clarify. Direct input goes off every frame. Testing getKey->K does not. This means that, if you're updating the position of ANYTHING, be it sprite, character or pixel, that thing will move every few frames if you're using getKey->K, and every frame if you're using direct input. I'm about 80% sure I know what I'm talking about. Tongue
I knew what you meant and I wasn't doubting your knowledge of Axe Tongue I was just asking lol.
Logged
JustCause
Coder Of Tomorrow
LV8 Addict (Next: 1000)
*
Offline Offline

Gender: Male
Last Login: 14 March, 2013, 00:30:22
Date Registered: 28 April, 2010, 19:35:41
Posts: 734


Total Post Ratings: +108

View Profile
« Reply #14 on: 19 July, 2011, 07:20:36 »
0

I wasn't doubting your knowledge of Axe Tongue
Again, don't take my word for it. Test it yourself. 'S always the best way to learn.

(Especially when I doubt my knowledge of Axe)
« Last Edit: 19 July, 2011, 07:20:53 by JustCause » Logged

Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 1.087 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.