Author Topic: Auto Optimization Program  (Read 49410 times)

0 Members and 6 Guests are viewing this topic.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Auto Optimization Program
« Reply #75 on: September 07, 2010, 10:06:51 pm »
Right, that'd be a problem. That and the other commands that need the last parenthesis. And remember implied multiplication doesn't work.




Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Auto Optimization Program
« Reply #76 on: September 08, 2010, 06:30:16 pm »
So i had a great idea!  Why not use InData() to search for trigger tokens in the program to be optimized?  I tested an 8000 bytes file and it could search through the entire file in less than a second!  This means possibility for lightning fast optimization!

Offline guy6020665

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 481
  • Rating: +7/-1
    • View Profile
Re: Auto Optimization Program
« Reply #77 on: September 08, 2010, 06:32:07 pm »
So i had a great idea!  Why not use InData() to search for trigger tokens in the program to be optimized?  I tested an 8000 bytes file and it could search through the entire file in less than a second!  This means possibility for lightning fast optimization!

Wow 8000 bytes in less than a second...thats insane

Edit: By the way, when's an executable coming? I think it seems to work well enough for a release.
« Last Edit: September 08, 2010, 06:34:52 pm by guy6020665 »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Auto Optimization Program
« Reply #78 on: September 08, 2010, 06:35:44 pm »
Hmm i just have to remember that using this method ignores strings, so that when i find a token to optimize, i will have to search backwards in the file to determine if its inside a string or not.  This also makes the loading bar a lot harder to implement since all the time spent searching will be spent in a single command.  Hmmmm i shall see how fast everything is

Offline guy6020665

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 481
  • Rating: +7/-1
    • View Profile
Re: Auto Optimization Program
« Reply #79 on: September 08, 2010, 06:39:58 pm »
Ok that's fine but at that speed would there even be need for a loading bar?

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: Auto Optimization Program
« Reply #80 on: September 08, 2010, 06:45:56 pm »
Wow that sounds promising, you should try it!

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Auto Optimization Program
« Reply #81 on: September 08, 2010, 06:48:10 pm »
Im trying it right now :) And yeah thats a good point XD if it takes more than a few seconds ill just have a loading message, or a small animation

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Auto Optimization Program
« Reply #82 on: September 08, 2010, 06:53:29 pm »
Wow, that is FAST!

And 8000 KB/s is about twice Axe's speed, so yeah, a loading bar is probably not needed. A loading message should be fine, and personally, I think a percentage counter is a good idea, just so that people optimizing a 20 KB program wouldn't think it froze after 2.5 seconds. Doesn't matter two much, though.

EDIT: Can I have a demo just for a quick test?

EDIT2: Wow, I meant 8 KB/s. If it were 8000, that'd be absolutely amazing for anything Z80 :P
« Last Edit: September 08, 2010, 06:54:55 pm by Deep Thought »




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: Auto Optimization Program
« Reply #83 on: September 08, 2010, 07:03:35 pm »
I wonder if your program can manage to optimize stuff such as (A-B)*5->C to 5(A-B->C ?

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Auto Optimization Program
« Reply #84 on: September 08, 2010, 07:05:34 pm »
Unfortunately no form of percentage can be calculated D: but i think it will be fast enough :) Currently i have no real working code however so i cant give anything out :P I did document all the optimizations i currently am implementing and they are up to 12 :)

As for the (A-B)*5->C, it currently isn't smart enough to do things like that, and i imagine getting it to the point where it can recognize expressions like that would be crazy hard to do, but if i figure out a way to do it, hells yeah i will :)

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: Auto Optimization Program
« Reply #85 on: September 08, 2010, 07:06:51 pm »
Ok, well good luck if you plan to add them ^^

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Auto Optimization Program
« Reply #86 on: September 08, 2010, 07:34:53 pm »
Garrg, so there are a lot of sneaky things happening now :P So InData stops as soon as it finds a 0, since thats the definition of the end.  BUT what about 2 byte tokens?  for example Str1 has a 0 as its second byte, so the optimizar treats that as the end of the program.  So now before it parses the program it goes through and changes all the 0's into 60, which is unused in all two byte tokens.  Then when the program is finished, it goes back and changes all the 60's back into 0's. lol

EDIT: Grrr but that means that it would mess up hacked variables.  Hmmm i will have to think about this some more...

EDIT2: Yay got it to work, if it quits and it finds that its not at the end of the file, it scratches its head and turns around and goes back into the search loop ^^
« Last Edit: September 08, 2010, 07:52:46 pm by Builderboy »

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Auto Optimization Program
« Reply #87 on: September 08, 2010, 08:12:47 pm »
Wow, that is really cool about the InData speed :) And glad you got things working right now :D Good luck with the rest of this and can't wait for another demo ;D
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

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: Auto Optimization Program
« Reply #88 on: September 08, 2010, 09:27:12 pm »
Nice that you got it sorted out.

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: Auto Optimization Program
« Reply #89 on: September 08, 2010, 09:49:25 pm »
so release date?
sorry, i am just so excited about the prospect of not having to optimize my DrugAdventure3 game that i am about to finish.
I made it just to make everyone mad. (it has over 50 different labels, and tons of goto's
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
____________________________________________________________