Post Reply 
How much memory may a HPPL program use on a G2?
09-09-2023, 10:41 AM (This post was last modified: 09-09-2023 10:48 AM by komame.)
Post: #19
RE: How much memory may a HPPL program use on a G2?
(09-09-2023 10:21 AM)Tyann Wrote:  However, I do see a problem with chains.
For example:
either a list {1285,128} if I search for 128 POS, will return 2 .
if I use a string with "," as a separator, for example .
this gives "1285,128" here INSTRING will return 1 instead of 6.
you then have to do an equality test, then run the search again if <>.

You have to use a little trick. Here's an example:
Code:
EXPORT LIST_EMU()
BEGIN
 local l1,s1;
 PRINT();
 l1:={1285,128,999,50000};
 s1:=CHAR(l1);
 PRINT(INSTRING(s1,CHAR(999)));
END;

Of course, there are other solutions for emulating a list based on strings, but the solution I've shown is the most efficient. There's just one limitation with this approach: the list can store only values from 1 to 65535. It cannot store the value 0. In the QUEENS algorithm, this is not a problem, and according to my tests, this approach was an excellent solution.
For very small lists, such emulation might be slower than a PPL list. However, the larger the list, the more the string-based emulation will outperform the PPL list. With lists on the order of tens of thousands of entries or more, the difference in performance can even be tenfold.

Within the next few days, I will prepare a description of various approaches to emulate a list using the string and publish it in a separate thread. Without the appropriate tools, we might not be able to efficiently replace 100% of the PPL list functionality, but in most cases, this could prove to be sufficient and, in fact, highly efficient, especially when the number of elements exceeds 10,000.

Best regards,

Piotr Kowalewski
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: How much memory may a HPPL program use on a G2? - komame - 09-09-2023 10:41 AM



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