RPL programming questions
|
02-18-2014, 11:31 PM
Post: #7
|
|||
|
|||
RE: RPL programming questions
(02-18-2014 07:15 PM)peacecalc Wrote: Surprising competition, A more typical use of both global and local variables in UserRPL uses the variable name without the single quotes, which implicitly "executes" the variable. In the case of numerical objects, this results in the object simply being recalled to the stack. As such, no explicit "RCL" step is required in your examples if the variables are referenced without the quotes. When changing the code in this way, I think you'll find the execution times of TGLO and TLOC are more in line with expectations. Here's your TGLO when re-coded in this manner: Code:
My 50g gives times of 23 secs for TGLO2 and 21 secs for TLOC2. IMHO, the real time savings for local variables comes when coding in SysRPL. SysRPL code can access locals in a special way that uses an offset table instead of named variables. This significantly reduces the time to locate the objects in memory. These locals have no names, and are referenced by a numerical index instead. To aid readability, SysRPL coders can take advantage of compiler DEFINEs to give meaningful names to these local variables as follows: Code:
SysRPL code usually provides a speed benefit, and the above is no exception. It completes on my 50g in 3 seconds. Regards - David |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 5 Guest(s)