| The United-TI Forum is Read-Only. | |
| 30 Aug 2008 03:06:19 pm by Weregoose | ||
| Assuming all stats are positive, try replacing this:
dim(LAM→A While LAM(A)=0 A-1→A End A→dim(LAM ...with this: cumSum(LAM 1+sum(Ans≠max(Ans→dim(LAM This will work faster only if there are plenty of zeros at the end of LAM. [EDIT] Also, in LEPA(B→Z, it'd be faster to access Ans repeatedly. |
||
| 30 Aug 2008 03:41:04 pm by calc84maniac | ||||
See if this works:
I got rid of LAM completely since you can just read the elements from LAL in the last loop. All you need to find is the value of A. Edit: Fixed a typo where Ans was used instead of LAL |
||||
| 30 Aug 2008 07:13:35 pm by tifreak8x | ||||
So, it would be faster to store Ans to both the list element and variable Z? I have to store to both because the list element is attack name, and Z gathers the attack data :/ |
||||
| 30 Aug 2008 10:26:12 pm by Weregoose | ||
| E3fPart(LAM(A→LEPA(B
Ans→Z Just like what calc84maniac did in his code (except his is using LAL). |
||
| 31 Aug 2008 10:17:31 am by tifreak8x | ||
| Well... still sitting at 9 seconds... anything else?
Edit: hmm, upon further inspecting, seems it one of the attacks twice to the pokemon... That is why I had the second list, was to keep from having that kind of problem.. |
||
| 31 Aug 2008 08:08:19 pm by calc84maniac | ||||||
Could the duplicate be because of the:
|
||||||
| 31 Aug 2008 11:32:47 pm by tifreak8x | ||
| No, the attack itself is LEPA(B
The rest is stats for attacks and such. There was no problem with duplicates before. How ever, it is nice to know that it is seeing more than 2 attacks. :) I am thinking on a way to rewrite all of that code to be smaller and faster... I have tomorrow off, so when I take my breaks from learning asm or whatever I am doing tomorrow, I will look at it again. |
||
| 03 Sep 2008 07:10:35 am by luby | ||
| Try commenting out each line with a " to find the problem. Note: you'll have to change the -> to a . or something when you comment it out. | ||
| 03 Sep 2008 08:36:15 am by tifreak8x | ||
| I looked into that, those pieces of code are not slowing it down, as they happen instantly. I am truly not sure what is slowing it down, probably the recall attack data program... I wonder if things speed up if I split them up into smaller programs... | ||
| 03 Sep 2008 10:47:00 am by JoostinOnline | ||
| Have you been testing the program by itself, or only when run as a subroutine? It could just be that you have something slowing it down in the main program right before it runs. | ||
| 03 Sep 2008 03:02:28 pm by tifreak8x | ||
| I tested the routines individually. F=1 runs in less than a second, iPart(F)=2 runs in less than 2, but F=2.5 runs over 9 seconds. I am certain it has to do with the while loops, just not certain at this time what to do to replace them. | ||
| 03 Sep 2008 07:14:37 pm by luby | ||
| ZRS is called twice. This looks like a potential slow down. | ||
| 03 Sep 2008 09:11:51 pm by tifreak8x | ||
| prgmZRS has one line in it, :Asm(prgmRESOURCE :P
I have shaved some time off of it, hoping to take off more now, by separating the attack data program. So far, took the LT out of the picture entirely, and added some :If Z<##:Return into the code to shave off 2 seconds. Edit: Splitting the attack data program in to two pieces shaved this off to just under 6 seconds. |
||
| 10 Sep 2008 07:22:35 pm by tifreak8x | ||
| Well, a bit of an update. I took and recombined the attack data programs, removed all the If Z=###: and made it so Celtic2 will read the data at the lines. This as shaved miliseconds off... So it is now nearly 5 seconds flat. It is not terrible, however, I am still hoping to improve it. I am, however, running into problems with it displaying incorrect data.
I am going to revert back to the original code, optimize some of it, and see if I can see what part of the code is causing the troubles. |
||
| The United TI Forum is Read-Only. | |
[Switch to Desktop view]
© Copyright 2000-2013 Cemetech & Kerm Martian :: Mobile Design by Alex "comicIDIOT" Glanville
Problems? Issues? Or Suggestions? There's a thread for that!
© Copyright 2000-2013 Cemetech & Kerm Martian :: Mobile Design by Alex "comicIDIOT" Glanville
Problems? Issues? Or Suggestions? There's a thread for that!
