Post Reply 
RPL programming questions
02-19-2014, 04:15 PM
Post: #11
RE: RPL programming questions
Hello HP50g fans,

first of all I can confirm the results of DavidM and thank you for simplefy my code. It is funny, of course in my all day programming the hp 50g I use consequently A instead of 'A' RCL (maybe it is a kind of sclerosis).


Now I've tested the creating of global, local variables and putting values (which are deleted in every through going of the loop) on the stack with three little programs. All proggies have a loop from 1 to 1000 and we also have five different store places.

TGLO for globals (182 sec)

Code:

%%HP: T(3)A(R)F(,);
\<< TICKS
    1, 1000, START 
         1, 'A' STO 
                2, 'B' STO 
         3, 'C' STO 
         4, 'D' STO 
         5, 'E' STO 
         { A B C D E } PURGE
           NEXT 
   TICKS SWAP - 8192 /
\>>

TLOC for locals (3 sec), here you don't need extra code for for deleting the variables, because after leaving the sub program the variables doesn't exist any longer.

Code:

%%HP: T(3)A(R)F(,);
\<< TICKS 
    1, 1000, START 
             1, 2, 3, 4, 5, \-> A B C D E
              \<<
             \>>
           NEXT 
    TICKS SWAP - 8192 /
\>>

TSTK with stack (2 sec)

Code:

%%HP: T(3)A(R)F(,);
\<< TICKS 
    1, 1000, START 
             1, 2, 3, 4, 5, 5, DROPN
           NEXT 
    TICKS SWAP - 8192 /
\>>

You see the globals are 90 times slower as the stack or 60 times slower as the local variant. That sounds very much, but how often you need a programm which create and deletes 5000 variables. Therefore if you are not familiar with SysRPL use simply locals it is fast as a stack storage place and you need not any code for organizing the stack. The argument for a more readable code is untouched.

greetings
peacecalc
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RPL programming questions - HP67 - 02-17-2014, 01:54 PM
RE: RPL programming questions - peacecalc - 02-17-2014, 03:10 PM
RE: RPL programming questions - Joe Horn - 02-18-2014, 01:06 PM
RE: RPL programming questions - HP67 - 02-18-2014, 01:39 PM
RE: RPL programming questions - peacecalc - 02-18-2014, 07:15 PM
RE: RPL programming questions - DavidM - 02-18-2014, 11:31 PM
RE: RPL programming questions - HP67 - 02-19-2014, 09:52 AM
RE: RPL programming questions - HP67 - 02-19-2014, 02:15 PM
RE: RPL programming questions - HP67 - 02-20-2014, 03:27 PM
RE: RPL programming questions - DavidM - 02-19-2014, 05:23 PM
RE: RPL programming questions - HP67 - 02-20-2014, 03:40 PM
RE: RPL programming questions - DavidM - 02-20-2014, 04:10 PM
RE: RPL programming questions - peacecalc - 02-19-2014 04:15 PM
RE: RPL programming questions - HP67 - 02-20-2014, 04:36 PM
RE: RPL programming questions - RMollov - 02-24-2014, 12:47 PM



User(s) browsing this thread: 5 Guest(s)