Repeats repeated

Terry Vogelaar terry at discovery.nl
Sun Nov 3 10:49:01 EST 2002


Richard Gaskin heeft op zondag, 3 nov 2002 om 07:49 het volgende 
geschreven:

> Every time you count a line number it eats time.  Arrays are faster 
> for this
> -- check out the split and combine commands to see how to convert 
> chunks to
> arrays andback again.

David Vaughan heeft op zondag, 3 nov 2002 om 08:27 het volgende 
geschreven:

> I can see why repeat for each failed here - you need to extract 
> subsets of the main list for each of the inner RFE loops for each time 
> through its outer loop. Thus, you are extracting by line numbers and 
> doing more work than in the first instance. RFE is fast through each 
> sub-list but the work of continually creating new lists is an 
> overwhelming burden. Not sure how to solve it using arrays as you seem 
> to wind up with the same problem only this time fiddling with keys. 
> Since Richard suggested that approach, perhaps he has something in 
> mind.....

I understand now why my 2nd script was so slow thanks to David. And 
like David I really cannot imagine why Richard's suggestion about using 
arrays would contribute anything to the speed, but I tried it and it 
obviously worked; it reduced my (fastest) 101 seconds to 36!

Thanks,
Terry





More information about the Use-livecode mailing list