Post Reply 
Optimizing HPP program
03-11-2019, 06:53 AM
Post: #2
RE: Optimizing HPP program
Hello,

Well, your program is a little bit screwy, so you get strange behaviors :-)

Anyhow, If you want to speed up a program, the main guidelines are:
- use local variables, not globals (locals are faster).
- your 100 "dummy" function are of course slowing down any lookup of non local variables as they enter relatively high in the variable precedence order and the lookup is (sorry about this) linear (the name list is not sorted). So adding 100 extra items to look through will slow down any search that has to traverse it.
- EVAL is a slow function.
- Put loops IN function, not function in loops. I know that it makes things less readable, but for (100) call_function end; is was slower than a function that does function(params, number of loops) for (number) do operation... This is mostly important for inner critical loops of course. Outside loops are much less impacted.

Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Optimizing HPP program - Oulan - 03-08-2019, 08:45 AM
RE: Optimizing HPP program - cyrille de brébisson - 03-11-2019 06:53 AM
RE: Optimizing HPP program - Oulan - 03-11-2019, 08:47 AM



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