I think that the byte saved (2 infact with the line break) more than makes up for the 1 millisecond lost...
Okay, let me say this: DelVar takes 2 bytes. The token itself is two bytes of memory. Make two programs, one empty and the other with one DelVar token. The difference is 2 bytes. Where DelVar saves memory is when it doesn't need the new line.
Oh, that's true. Quite right. But in a program where you're setting perhaps 10 or 12 variables to 0, DelVar more than makes up for it's 0.001 second overhead.
KermMartian wrote:
Oh, that's true. Quite right. But in a program where you're setting perhaps 10 or 12 variables to 0, DelVar more than makes up for it's 0.001 second overhead.


Quote:
you miss a major point, I ran a similar program, but after the 0->/delvar, I had it display, and the 0-> beat dlevar by over 15 seconds per 1000, there is a diffrence.


sounds like more than .001 seconds to me Rolling Eyes
16 seconds because of the extra disp Very Happy
KermMartian wrote:
16 seconds because of the extra disp Very Happy


its not the disp's fault, its the delvar's fault - BOTH routings had the disp added he said, and the DIFFERENCE was 15 seconds. The REASON is the re-initialization of the variable - which is WHAT I'VE BEEN SAYING!!!!!!!

just admit it, DelVar is way slower than 0->var in the long run (maybe the actual statement execution time isn't very different, but the next time the var is used, you'll be paying for that previous delvar)
exactly what I saw
Yeah, true. Sad
I'm thinking of making it a choice to optimize by size or speed, what do you think?
yeah, as an option, I like it. How about also a list on changes done by optimizations, so this way it is easier to learn form mistakes
Yeah, that's already gonna be a feature. Smile
you talking the list of changed? cool
Well, about the only time i use Delvar is when the game is exiting, and I have it go through the 'cleanup' step. Smile I delete all unnessacary variables/lists/etc.
Ah yes. I tend not to put that into my programs, figuring people will be using other progs that will just recreate the vars anyway. My exceptions are lists and pics created.
Using on-calc timer, TI-84+ SE:

Code:
:DelVar XStartTmr->L
:Repeat X=1000
:Delvar ZX+1->X
:Disp X
:End
:CheckTmr(L

Takes up 43 bytes of RAM and runs in 73 sec.


Code:
:DelVarXStartTmr->L
:Repeat X=1000
:0->Z
:X+1->X
:Disp X
:End
:CheckTmr(L

Takes up 44 bytes of RAM and runs in 74 sec. (Disp command adds 62 seconds to execution time)
How significant. Take your pick.
See, DelVar wins! Very Happy Cool
So any time you want to use a 1000-trial iteration Rolling Eyes , use DelVar.
@Kllrnohj: Apologies in advance for backing the evidence.
like I said, now display Z or use it, then 0-> beats delvar
Kuro wrote:
So any time you want to use a 1000-trial iteration Rolling Eyes , use DelVar.
@Kllrnohj: Apologies in advance for backing the evidence.

lol Let's just leave this be, shall we?
Sounds good. I'm tired of arguing.
As am I. Topic closed.
  
Page 2 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement