Livecode performance problem

Alex Tweedly alex at tweedly.net
Fri Aug 19 19:46:54 EDT 2022


On 20/08/2022 00:03, Bob Sneidar via use-livecode wrote:
> It's probably a lot of text. The engine has to start from the beginning of every string then scan through for every cr or lf or cr/lf or whatever counts as a line break, until if finds the nth one. The more lines, the longer the scan takes each time, and the more text per line the exponentially more time it takes. Multiply that by 4 times plus the combinination of all of them as the code progresses *4 for the output string and you have the makings of a mountain that keeps getting steeper the higher you go.

Yes, for all the input strings. For the output string, it's just a "put 
... after ...", so there is no need to count or scan the output string; 
LC already keeps (effectively) a pointer to the end of a string, and 
optimizes the straightforward extension at the end of a string.

Alex.





More information about the use-livecode mailing list