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.
Visit my site at http://nerdyproductions.sobertillnoon.com
PokéGen on Sourceforge:
http://www.sourceforge.net/projects/pokegen
ticalc profile
PokéGen on Sourceforge:
http://www.sourceforge.net/projects/pokegen
ticalc profile
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
KermMartian wrote:
16 seconds because of the extra disp
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)
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
Well, about the only time i use Delvar is when the game is exiting, and I have it go through the 'cleanup' step. 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:
Takes up 43 bytes of RAM and runs in 73 sec.
Code:
Takes up 44 bytes of RAM and runs in 74 sec. (Disp command adds 62 seconds to execution time)
How significant. Take your pick.
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.
So any time you want to use a 1000-trial iteration , use DelVar.
@Kllrnohj: Apologies in advance for backing the evidence.
@Kllrnohj: Apologies in advance for backing the evidence.
Kuro wrote:
So any time you want to use a 1000-trial iteration , use DelVar.
@Kllrnohj: Apologies in advance for backing the evidence.
@Kllrnohj: Apologies in advance for backing the evidence.
lol Let's just leave this be, shall we?
» Goto page Previous 1, 2
» View previous topic :: View next topic
» View previous topic :: View next topic
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
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