Post Reply 
RPL second impressions (HP 28)
06-30-2018, 02:14 AM
Post: #25
RE: RPL second impressions (HP 28)
(06-29-2018 07:35 PM)Gerson W. Barbosa Wrote:  This means my stack handling is not efficient. When properly done it should be faster than using local variables.

Don't consider me an expert so I could be totally wrong, but I would recommend:
  • Avoid global variables in a program.
  • Use local variables for immutable values to reduce the amount of objects on the stack.
  • Use only the simplest stack-manipulating commands as DUP, SWAP, OVER or ROT.

I could imagine that creating a context for local variables is somewhat expensive. So don't do that within a tight loop. But accessing local variables should be fast. Similar to something like DUP or +.

In UserRPL the overhead for each command is big compared to actually doing it.
Thus reducing the amount of commands within a loop helps.
Just by counting the commands in the DO-loop we can see that their ratio 11 ÷ 12 is close to the ratio of durations: 201 ÷ 214.

Use SysRPL if time really matters.

Cheers
Thomas
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RPL second impressions (HP 28) - mdunn - 06-27-2018, 01:19 AM
RE: RPL second impressions (HP 28) - mdunn - 06-27-2018, 01:58 PM
RE: RPL second impressions (HP 28) - mdunn - 06-27-2018, 04:06 PM
RE: RPL second impressions (HP 28) - mdunn - 06-27-2018, 05:11 PM
RE: RPL second impressions (HP 28) - mdunn - 06-27-2018, 07:45 PM
RE: RPL second impressions (HP 28) - mdunn - 06-28-2018, 08:48 PM
RE: RPL second impressions (HP 28) - Thomas Klemm - 06-30-2018 02:14 AM
RE: RPL second impressions (HP 28) - ttw - 07-04-2018, 10:52 PM



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