Intersecting data question/challenge

Dennis Brown see3d at writeme.com
Fri Jul 8 22:01:09 EDT 2005


Raymond,

Good idea.  It does get around the need to iterate to get the keys.   
Unfortunately, that operation seems to be very slow in Rev.  If I use  
the data from the previous tests, and do everything starting with the  
lists, is is 10 times slower than my first example.  If I save the  
constant array first, it is 5 times slower.  If I save both arrays  
and only get the get the customProperties to the array in the timing  
loop, it is still twice as slow, which is 17 times slower than the  
fastest way.

So you met the challenge of no loops --good job.  But the Rev setting  
customKeys and getting customProperties seems to be much slower than  
any other operations tested.  They must be using the crawl method for  
those operations.

Dennis

On Jul 8, 2005, at 8:26 PM, Raymond E. Griffith wrote:

> on mouseUp
>   put 5000 into n1
>   put 2000 into n2
>   repeat with i = 1 to n1
>     put random(10000) & cr after A
>   end repeat
>   repeat with i = 1 to n2
>     put random(10000) & cr after B
>   end repeat
>   put the long milliseconds into ms
>   set the customkeys of fld "LA" to A
>   set the customkeys of fld "LB" to B
>   put the customproperties of fld "LA" into arrA
>   put the customproperties of fld "LB" into arrB
>   intersect arrA with arrB
>   answer keys(arrA) & return & "___" & the long milliseconds - ms
> end mouseUp
>




More information about the use-livecode mailing list