Post Reply 
How much memory may a HPPL program use on a G2?
09-09-2023, 03:52 PM (This post was last modified: 09-09-2023 04:00 PM by komame.)
Post: #29
RE: How much memory may a HPPL program use on a G2?
(09-09-2023 03:07 PM)Tyann Wrote:  The AVars ("N9") for example contains 50,183 words spread over 6 sub-lists.
Even if there are less than 10000 words, they are still in a sub-list, so the search function always uses the same principle: a FOR loop from 1 to the number of sub-lists, then search by sub-list.

So now, when someone provides a word with missing letters, does your algorithm search through all the words in all 6 lists and even compare them to words of different lengths? If that's the case, it explains the performance issue you're facing. If you were to divide these lists based on word length, I suspect the speed of operation would be much higher.
Let's assume you have a list of lists with words like this:

{
  { }, //stays empty because there is no one-letter words
  { "aa", "ab", "bc", "cd" ... },
  { "aaa", "abc", "bde", "cad" ... },
  { "abcd, "bcde", "cbde", "dbfe" ... },
  { ..... }
}


When someone searches for a word, you can perform the search that way:
main_list => the main list divided into sublists based on the word length.
search_for => the searched word

Code:
POS(main_list(DIM(search_for)),search_for)
This will search only the specific list for the given word length.
Then you don't need to iterate through all the lists; the search will immediately occur in the correct list where the result is guaranteed. The algorithm won't search through the remaining lists because it doesn't make sense to do so.

This optimization, especially for matches with missing letters, could significantly speed up the process. Additional, for matches with missing letters it's important to copy the target sublist to a local variable. These lists will be much shorter than what you currently have, so I suspect it will perform faster than using AVars with big list.

The point is that working with small, well-divided lists in PPL is much faster than with large lists. If possible, they should be divided.
It may turn out that such optimization is sufficient, and you won't even need to change from using PPL lists to emulating using strings.

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 03:52 PM



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