Efficient code for accessing the items (or lines) in a variable.

Colin Holgate coiin at verizon.net
Sun Feb 20 21:08:10 EST 2011


On Feb 20, 2011, at 8:29 PM, Alex Tweedly wrote:

>  added the highlighted lines below, and then re-ran your tests
> 
>                    as-is     using item
>> 
>> foreach        85         159
>> repeatwith   93       3102
>> countarray 276         367


I added them in mine too. I had to decrease from 10,000 to 1,000 loops, so I wasn't waiting all day, and got these values:

foreach 238
repeatwith 4139
countarray 597

At least the array way ended up being not as bad as it first seemed.





More information about the use-livecode mailing list