Re: HP48 : recursion : more and more slower
- From: Dave Hayden <dave@xxxxxxxxx>
- Date: Tue, 17 Feb 2009 06:57:49 -0800 (PST)
On Feb 17, 7:34 am, "John H Meyers" <jhmey...@xxxxxxxxxxxxxx> wrote:
On Tue, 17 Feb 2009 04:42:07 -0600:
A SWAP exchanges stack pointer 1 with stack pointer 2.
If you look into SWAP you see that the pointers are written into the
CPU and from there into memory.
So, memory changes, the system goes through all pointers (keeps track
of all pointers) and the time needed for this depends on the number of
pointers the system has to keep track of.
I still don't follow the "goes through" and "keeps track" details here :)
John is right. The stack is just an sequence of pointers. SWAP just
exchanges the top two. Adding or dropping items from the stack just
adds a new pointer and changes the register that points to the top of
the stack. It doesn't move or even look at the rest of the stack.
I'm aware of two, possibly three, times when the entire stack is
scanned, garbage collection, moving an object in temporary memory
(when all references to the object must be updated) and (possibly)
setting up error processing (sorry, I can't recall the exact command
here). In the latter case, the stack might be copied, I'm not sure.
But in the recursive program, it was the RETURN stack that grows, not
the data stack. So I'm thinking that it's the error processing and
it's copying the return stack as well as the data stack. I believe
that most SysRPL commands don't do error processing. Does one of the
commands in the original program do it?
Dave
.
- Follow-Ups:
- Re: HP48 : recursion : more and more slower
- From: Andreas Möller
- Re: HP48 : recursion : more and more slower
- References:
- HP48 : recursion : more and more slower
- From: stfox
- Re: HP48 : recursion : more and more slower
- From: John H Meyers
- Re: HP48 : recursion : more and more slower
- From: stfox
- Re: HP48 : recursion : more and more slower
- From: Andreas Möller
- Re: HP48 : recursion : more and more slower
- From: stfox
- Re: HP48 : recursion : more and more slower
- From: Andreas Möller
- Re: HP48 : recursion : more and more slower
- From: John H Meyers
- HP48 : recursion : more and more slower
- Prev by Date: Re: HP50G - How to use built-in variable browser in Equation Libibrary?
- Next by Date: Re: HP 50g keyboard layout
- Previous by thread: Re: HP48 : recursion : more and more slower
- Next by thread: Re: HP48 : recursion : more and more slower
- Index(es):
Relevant Pages
|