Fast/slow code example (was: Re: compileIt for revolution?)

Jeanne A. E. DeVoto revolution at jaedworks.com
Sun Jun 26 18:01:55 EDT 2005


At 1:09 PM -0600 6/24/2005, Dar Scott wrote:
>On Jun 24, 2005, at 12:42 PM, Jim Bufalini wrote:
>
>>However, the "repeat with i =" form being slower than the "repeat for each"
>>was news to me!
>
>It should be mentioned in the docs.  (And probably is and I don't know where.)


In the dictionary for the "repeat" control structure. ;-)

"Use the for each form if you want to perform an action on each chunk 
in a container. This form is much faster than the with countVariable 
= startValue to endValue form when looping through the chunks of a 
container."

(It doesn't go into detail about why this is so, though, and that 
would be interesting and perhaps useful information to add.) There 
also used to be some mentions of this in the cookbook, although the 
cookbook seems to have gone away.
-- 
jeanne a. e. devoto ~ revolution at jaedworks.com
http://www.jaedworks.com



More information about the use-livecode mailing list