Remote Find Questions Revisited

Rob Cozens rcozens at pon.net
Mon Apr 26 21:06:27 EDT 2004


At the end of March I wrote:

>Perhaps I am incorrect here, in that if the engine maintains an 
>index of marked cards, "unmark all cards" can simply empty the 
>index, rather than set a property on each card.  But the Transcript 
>Dictionary lists "mark" as a card property; so that leads me to 
>assume "mark [or unmark] all cards" sets the property on each card.
>
>I'd need to do some timing tests to get beyond idle conjecture; but 
>if forced to bet, my money is on mark/unmark all cards touching 
>every card in a stack.

I've just completed a simple timing test:

* Stack with button "Start Test" & field "Test Results"

* Button script:

on mouseUp
   answer file "Select the stack:"
   if the result is "cancel" then exit mouseUp
   put it into targetStack
   push card
   lock messages
   go invisible to card 1 of stack targetStack
   put 0 into totalMarkTime
   put 0 into totalClearTime
   repeat 1000
     subtract the ticks from totalMarkTime
     mark any card
     add the ticks to totalMarkTime
     subtract the ticks from totalClearTime
     unmark all cards
     add the ticks to totalClearTime
   end repeat
   close stack targetStack
   pop card
   put (targetStack&":"&return&(the number of cards of targetStack)&& \
     "cards"&return&(totalMarkTime/1000)&&(totalClearTime/1000)) into \
     field "Test Results"
end mouseUp

Results:	Cards	Mark	Unmark

		147	.001	0
		6177	.112	.079
		43046	.677	.635

So the time it takes to mark a single card or unmark all cards varies 
directly with the number of cards in the stack.
-- 

Rob Cozens
CCW, Serendipity Software Company
http://www.oenolog.net/who.htm

"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."

from "The Triple Foole" by John Donne (1572-1631)


More information about the use-livecode mailing list