Post Reply 
Prime and 50g, interesting perspective
09-02-2021, 10:11 PM
Post: #13
RE: Prime and 50g, interesting perspective
(09-02-2021 05:18 PM)ijabbott Wrote:  However, I understand global symbol look-ups in RPL are rather slow? (No doubt newRPL would speed things up a lot.)
Hey, are you optimizing for speed again?
Some optimization may be needed because we don't want to wait for hours, but there is a point at which the gains in speed (or memory) are not worth the loss of readability. The pragmatic answer would be: test if an optimized version brings major gains, and if not, keep it readable instead. For this particular optimization, I would expect it to - in most cases - not make a worthwhile difference.

If you are still worried, you can make an effort to keep the number of global variables searched before finding a match low ... by using directories, because only the current directory and its direct and indirect parents are searched, subdirectories of any of these are not. Simply tell your program where to find its subroutine, and the global name search will find it without having to look at the whole collection.
As a bonus, you get to organize your programs in some way, which wouldn't be such a bad idea by itself, because it also helps others and future you understand the whole deal better by defining a meaningful structure.
Picking up the Hamilton product example once more, you might store it in a 'QuaternionMath' directory and thereby make it glaringly obvious to readers that it relates to quaternions, even if they are not familiar with the term "Hamilton product".
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Prime and 50g, interesting perspective - 3298 - 09-02-2021 10:11 PM



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