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.



_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to