Post Reply 
How much memory may a HPPL program use on a G2?
09-20-2023, 05:50 AM
Post: #77
RE: How much memory may a HPPL program use on a G2?
Hi Tyann,

(09-20-2023 04:55 AM)Tyann Wrote:  Looking at your code, I got an idea for optimisation. My letter comparison loop always started at 1 and I saw that you start at 2 when the first letter is known.
In fact, you can take the reasoning a step further:
For P???e?? the loop can start at 5, for ??e??r??? it will start at 3 and for sc???es
it must start at 2.
I already have such optimization for patterns that start with '?'.
This loop handles it:
Code:
  for n from 2 to length do
   if wts[n]=63 then
    continue;
   else
    break;
   end;
  end;
After its execution, the variable 'n' contains the position from which each word will be scanned.
However, indeed, it might also be applicable to words for which the first letters are known, and then there are '?' characters. I will add this optimization and compare the results. Thanks for this idea.

(09-20-2023 04:55 AM)Tyann Wrote:  Another thing you can do in the convaccent loop is to put in a test:
Code:

IF MAX(ASC "str"))<223 THEN BREAK; END
In other words, if there are no or no more accents, leave the 'replace' loop.
I have doubts about this. Of course, I will check it because the idea is interesting, but instead of using MAX, I will use INSTRING, and then I can skip specific iterations for individual characters. Nevertheless, I am concerned that in most cases, it may even introduce additional slowdown because there are very few dictionaries of a specific word length that do not contain some diacritical characters. Even if such situations occur, they are usually only for dictionaries with a small number of words, and in the case of small dictionaries, the conversion currently happens almost instantly. On the other hand, if the dictionary is large, most likely, all diacritical characters are present in it, and applying this approach will only add extra checks, taking additional time without bringing any benefits. However, the modification is easy to make, so I will conduct tests and let you know.

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-20-2023 05:50 AM



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