Post Reply 
How much memory may a HPPL program use on a G2?
09-18-2023, 07:37 PM
Post: #69
RE: How much memory may a HPPL program use on a G2?
Jeff,

(09-18-2023 08:27 AM)jte Wrote:  I just like to cheat a bit and run code before "the real run" begins and the timers come out...
I understand you perfectly, I often feel the same way.

Quote:one possible result of it would be to change REPLACE so that lists (in the strings case) could be given as the second and third arguments, to enact multiple replacements with a single PPL call. (e.g., allow "replace(str,accents,latin);" to be used in CROSSWORDS' convAccents(-) instead of the looped call to REPLACE that is currently being done.)
I think using a list as the second and third parameter here won't make much difference. Notice that you have to perform the replacement sequentially; you can't replace all found values at once in a single iteration over the text string because they may overlap. It would only make sense for 1-character elements, but I guess you won't impose a limitation that only 1-character elements can be provided in the list, right? The iteration itself in 'accentConv(-)', excluding REPLACE, only takes 1ms, and that's the only time you can save. To illustrate this: imagine someone uses REPLACE like this: replace("AABBABAB",{"AB","BA"},{"BA","AB"}). How would that work? The only reasonable implementation is to perform it sequentially, but it won't be any faster than the current PPL version with iterations.

Piotr
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-18-2023 07:37 PM



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