Author Topic: The Optimization Compilation  (Read 95777 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
Re: The Optimization Compilation
« Reply #90 on: March 07, 2011, 01:59:01 am »
I'm a little confused... I'm not sure in what context you would be switching clock speeds. And by a compatibility mode, do you mean the fact that the DispGraph routine waits for the screen driver to say that it's ready? I'm a bit confused about that because calling it a compatibility "mode" would suggest that there's something you can just turn on to automatically activate the safety.

But disregarding things I'm confused about, I do know that the two commands are close to the same speed speed, but because DispGraphr avoids driver readiness checking, it is in fact faster than DispGraph at 6MHz. And you can't really compare them at 15MHz, because DispGraphr doesn't work properly at that clock speed due to the lack of driver checking. Also, you don't need to store to the back buffer every frame for DispGraphr, you can still display black and white images by just keeping the back buffer clear.
« Last Edit: March 07, 2011, 02:12:36 am by Runer112 »

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: The Optimization Compilation
« Reply #91 on: March 07, 2011, 02:12:31 am »
'Twould be something like
Normal
DispGraphr
Full
The 6MHz clock setting is a compatability mode. And Axe checkerboards the grey areas in DispGraphr.
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: The Optimization Compilation
« Reply #92 on: March 07, 2011, 02:15:18 am »
Oh, well I haven't tested it but I think that still might be slightly faster than DispGraph at 15MHz, not 100% sure though. It would certainly be closer. And as long as you keep the back buffer blank, using DispGraphr would result in the same image put on the screen as DispGraph.


EDIT: Actually let me test this right now...


EDIT 2: The results are in! Data first, analysis after.

  • [Normal speed] DispGraphr: ~94 fps
  • [Normal speed] DispGraph: ~76 fps
  • [Full speed]      DispGraph: ~114 fps

At normal speed (6MHz), DispGraphr is about 25% faster than DispGraph. However, with an interesting turn of events, at full speed (~16MHz on my calculator) the results are pretty much reversed, with DispGraph being about 20% faster than DispGraphr. Now that I think of it, this makes sense. The DispGraphr routine runs about as fast as data can be outputted to the LCD driver. At 6MHz, the DispGraph routine is incapable of running this fast, because the driver readiness check slows things down a good amount for each failed check. However, at 15/16MHz, the check will be running very quickly and should continue execution much more swiftly after the driver becomes ready, resulting in only a little bit of overhead from the checking. After the check is exited, the remainder of the loop will then execute very quickly as well, making up most of the lost overhead from checking by performing the remainder of the loop in less than half the normal time. On top of this, the rest of the routine, including setup and the loop that the data sending loop is inside of, will run more than twice as fast, explaining the switch in the speed placings.
« Last Edit: March 07, 2011, 02:47:28 am by Runer112 »

Offline Freyaday

  • The One And Only Serial Time Killing Catboy-Capoeirista-Ballerino
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1970
  • Rating: +128/-15
  • I put on my robe and pixel hat...
    • View Profile
Re: The Optimization Compilation
« Reply #93 on: March 07, 2011, 03:04:13 am »
Ta-Da! Counterintuitivity strikes again! But this is officially a lesson: Always double check. And make sure it's been single-checked, too.
In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


I'm a performer at heart; I stole it last week.
My Artwork!

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: The Optimization Compilation
« Reply #94 on: June 09, 2011, 10:39:05 am »
Ok, I have no idea what's going wrong with this...
I've been optimizing dimansion shift.  Thing is, the inData() trick always returns as true ???
It worked in a little test program I made, but as soon as I put it into the shift source, it bugs.

In the screenie of the source, the unoptimized yet working line is shown just above the commented buggy line.
No matter wha the value of {P+D} is, it always returns true, be it any number that appears in the level (any num from 0 to 11)

btw, I tried storing {P+D} to a var and substituted {P+D} for the var in the code, still the same problem...
« Last Edit: June 09, 2011, 10:39:33 am by Darl181 »
Vy'o'us pleorsdti thl'e gjaemue

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: The Optimization Compilation
« Reply #95 on: June 09, 2011, 10:44:35 am »
uh, data(2,3,0) O.o?
I'm not a nerd but I pretend:

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: The Optimization Compilation
« Reply #96 on: June 09, 2011, 11:47:10 am »
That is indeed very strange...(btw aeTIos, the Data(2,3,0) is correct)

Perhaps it may be because {P+D}=0? If it is equal to 0, then the inData() routine will return 3 (which will read as true). You'll have to deal with the zero case separately.
« Last Edit: June 09, 2011, 11:47:43 am by squidgetx »

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: The Optimization Compilation
« Reply #97 on: June 09, 2011, 02:30:58 pm »
Quote from: self
No matter what the value of {P+D} is, it always returns true, be it any number that appears in the level (any num from 0 to 11)
Even when it equaled, say, 8, it would return as true (is that the right way to say it btw) and draw a door.
(what this if statement is part of is the level drawing code, if this line is true then draw a door)

Hm..might the nested For() loops it's inside of have anything to do with it?
EDIT: actually nvm that, it did the same thing in the repeat loop

EDIT2: info axe version 053, running on an 84pbe running os2.43.  Has extra ram if that makes a diff :P
« Last Edit: June 09, 2011, 02:34:54 pm by Darl181 »
Vy'o'us pleorsdti thl'e gjaemue

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: The Optimization Compilation
« Reply #98 on: June 09, 2011, 04:56:55 pm »
I tested that exact inData() situation and got the expected result of 0. All I can think of is either P+D is pointing to the wrong place or {P+D} equals zero, which will throw off the inData() command.

Anyway, if you want to test if the value equals 2 or 3, you can test much more efficiently with the following code:
Code: [Select]
!If {P+D}/2-1
  .{P+D}=2 or 3
End

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: The Optimization Compilation
« Reply #99 on: June 09, 2011, 06:25:37 pm »
I have something in place that works atm, but it seems wherever I use inData it does the same thing (doesn't work).  Just in that one program..
Vy'o'us pleorsdti thl'e gjaemue

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: The Optimization Compilation
« Reply #100 on: July 14, 2011, 11:02:47 pm »
In Axe 1.0.0, new compiler optimizations allow you to further optimize If statements comparing to single-byte constants!
Whereas before you would do something like !If A-7, now you can save a byte and 10 clock cycles by doing !If A xor 7
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: The Optimization Compilation
« Reply #101 on: July 14, 2011, 11:24:28 pm »
=D i'm amazed that axe can just continually get faster like it has been for months now.

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: The Optimization Compilation
« Reply #102 on: October 20, 2011, 10:19:51 pm »
don't forget about just *2
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 squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: The Optimization Compilation
« Reply #103 on: October 21, 2011, 07:34:31 pm »
^^Sorry, what? Explain a little more, please

This is getting out-dated :( but I haven't used 1.0.5 enough to figure out all the auto opts and new opts that can be (ab)used :P

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: The Optimization Compilation
« Reply #104 on: October 21, 2011, 08:12:21 pm »
just like....
0->A+1->B
is more optimized than
0->A
1->B
....
4->A * 2->B
is more optimized than
4->A
8->B

||||||||||||||||||||||||

also, i think 'number less than 256' /256 might be more efficient than just 0
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
____________________________________________________________