Efficiency question for list modification

Bob Sneidar bobs at twft.com
Fri Mar 11 12:54:43 EST 2011


hmmm interesting, concatenation is much better than enumeration. Whoda think it? I will keep that in mind for large data sets. Thanks for the info! 

Bob


On Mar 11, 2011, at 3:24 AM, FlexibleLearning wrote:

> Proof of how optimized syntax can make an enormous difference to speed (by
> orders of magnitude in this case).
> 
> This is BAD...
>  repeat for each line L in tData
>    add 1 to n
>    put (item 1 of L/div1) into item 1 of line n of stdout
>    put (item 2 of L/div2) into item 2 of line n of stdout
>  end repeat
> 
> This is GOOD...
>  repeat for each line L in tData
>    put (item 1 of L/div1) &","& (item 2 of L/div2) &CR after stdout
>  end repeat





More information about the use-livecode mailing list