Author Topic: Documentation of the Speed and Size of (Almost) Every Axe Command  (Read 25502 times)

0 Members and 1 Guest are viewing this topic.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
TL;DR : An Axe command list with size, speed, and notes for Axe commands. Good for optimizing.



I'd say I'm fairly decent at optimizing Axe programs. This stems partially from my good amount of experience with Axe. After having used Axe for a long time, I know all of the commands and options available, so when trying to make code to do something, I can usually think of many different ways to do it. Knowing offhand the sizes of a decent number of commands helps me eliminate a large number of these options, and between what's left, I often just try each option one by one, compiling the program with each option and seeing which is the smallest.

What helps even more to optimize my code is my experience with z80 assembly. When thinking about the smallest or fastest way to do something, I could think of the assembly code that Axe commands break down into and actually count bytes and cycles for a very exact comparison.

The Auto Opts.txt file included in Axe releases helped me learn a lot, but it only lists the sizes of what its name would suggest, the automatic optimizations. And although those often help to produce the smallest sizes, what about speed? And what about commands that aren't listed there? I often had to resort to methods like I talked about above, such as brute force testing all the options or trying to step through the assembly in my head. But those can be difficult and time consuming, even for someone with a lot of experience.

So I decided to make a list, detailing some specifications about every Axe command. This means basic loading and saving, auto optimizations, math routines, graphic routines, everything. For every command, I listed the command's size and equivalent Axe code. With this file, you could determine the exact size of anything you can do in Axe. It also lists the exact or approximate time that most commands take, so you can optimize for speed as well, something which is much harder to determine than size without examining the underlying machine code for every command. But I did just this, so others who are able to don't have to spend the lengthy amount of time doing so, and so others who aren't able to don't have to be able to.

I am missing the speed of some commands, as the remaining ones are some of the more challenging ones to test. I hope to test all of these eventually, but for now I'll release what I have. But for the commands that do have speed documented, you can learn some interesting things. Like how Pt-Off() is faster than Pt-On() and Pt-Change() for drawing aligned sprites (x and y are multiples of 8), but slower for unaligned sprites. Or how, on my calculator's hardware at least, DispGraphr is actually faster than DispGraph.


Anyways, without further ado, I'll attach the file. I highly suggest viewing it in a text editor like Notepad. Without a monospaced font and an 8-character tab width, it won't look pretty. I'll try to keep it up to date and modify it as new versions of Axe come out so you can always have a copy you can know is accurate for the current version.


Tip: To search for a specific command, try using your text file viewer's find feature to search for the Axe source code equivalent.





If you see any errors or have any questions or suggestions, just post them here.

Current version: 0.5.3b

« Last Edit: May 28, 2011, 08:22:38 pm by Runer112 »

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: Documentation of the Speed and Size of (Almost) Every Axe Command
« Reply #1 on: January 10, 2011, 01:37:15 pm »
Wow, I never fully realized how close in speed Axe is to ASM.  Still not as fast, but in most respects it's pretty dang close

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Documentation of the Speed and Size of (Almost) Every Axe Command
« Reply #2 on: January 10, 2011, 01:53:06 pm »
Erm, I tried opening it in notepad, and I got normal text interspaced with a bunch of garbage/chinese characters.
Is there a particular encoding I should use?
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Documentation of the Speed and Size of (Almost) Every Axe Command
« Reply #3 on: January 10, 2011, 03:05:02 pm »
Oh yeah, it's a Unicode text file because it uses some special characters like → and ►. I thought stuff like that was saved in a file header or something, but I guess not. Is there a certain way to open a text file in Unicode format that I should tell people about?
« Last Edit: January 10, 2011, 03:07:37 pm by Runer112 »

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Documentation of the Speed and Size of (Almost) Every Axe Command
« Reply #4 on: January 10, 2011, 03:15:42 pm »
How to open this? xD Nice job Runer.

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: Documentation of the Speed and Size of (Almost) Every Axe Command
« Reply #5 on: January 10, 2011, 03:17:09 pm »
Oh yeah, it's a Unicode text file because it uses some special characters like → and ►. I thought stuff like that was saved in a file header or something, but I guess not. Is there a certain way to open a text file in Unicode format that I should tell people about?

Try making the first few characters things that only exist in Unicode. I remember something like this with typing in "bush hid the facts"
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Documentation of the Speed and Size of (Almost) Every Axe Command
« Reply #6 on: January 10, 2011, 04:54:52 pm »
Very nice!  None of my text editors can read the file properly but I can still kind of see some of it.  This would definitely be better in the documentation than the AutoOps file.  It seems difficult to maintain and keep updated though since the commands change so often.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Documentation of the Speed and Size of (Almost) Every Axe Command
« Reply #7 on: January 10, 2011, 04:57:09 pm »
Hmm it seems that lots of people are having trouble with this file... Let me try thepenguin77's suggestion. The first few characters in the file are now Unicode characters. Does this file render correctly?

EDIT: Nope, definitely doesn't, I just tried it myself. I'll keep looking into this.

EDIT 2: Yay, looks like I got UTF-8 to work! I'll reattach the file to the first post immediately.
« Last Edit: January 10, 2011, 05:34:57 pm by Runer112 »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Documentation of the Speed and Size of (Almost) Every Axe Command
« Reply #8 on: January 10, 2011, 05:18:41 pm »
The new version works fine in Notepad and Opera. I haven't tried in other softwares, though. Very nice Runer112, it should be useful for in-depth optimizations :D

I think it should be included with Axe.
« Last Edit: January 10, 2011, 05:18:48 pm by DJ Omnimaga »

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Documentation of the Speed and Size of (Almost) Every Axe Command
« Reply #9 on: January 10, 2011, 05:50:46 pm »
oh shi-

very nice, will def. be taking a look at this later :D

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: Documentation of the Speed and Size of (Almost) Every Axe Command
« Reply #10 on: February 02, 2011, 01:41:14 pm »
why isn't this stickied?
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6268
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Documentation of the Speed and Size of (Almost) Every Axe Command
« Reply #11 on: February 02, 2011, 02:32:01 pm »
Good question, why isn't it?
/e

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Documentation of the Speed and Size of (Almost) Every Axe Command
« Reply #12 on: February 02, 2011, 02:34:42 pm »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Documentation of the Speed and Size of (Almost) Every Axe Command
« Reply #13 on: February 12, 2011, 07:38:46 pm »
It wasn't because Quigibo hated having too many stickied threads. The last time I stickied many he sent me an e-mail so I unsticky them. However with the new sub-forum I guess it isn't a huge issue anymore.

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Documentation of the Speed and Size of (Almost) Every Axe Command
« Reply #14 on: February 13, 2011, 01:03:20 pm »
Also Runer, I was wondering, can I make a html version of it?

Since I have quite a few calculator programming databases in my website (Bcalls, hex instructions and prizm equates), could I host it at my website?