Remote Find Questions Revisited
Rob Cozens
rcozens at pon.net
Wed Apr 28 10:53:32 EDT 2004
>I think it's not necessarily a function of the number of cards,
but the fact that you have "mark any card"
Ken, et al:
on mouseUp
put empty into field "Test Results"
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 the number of cards into cardCount
put cardCount-40 into cardToMark
put 0 into totalMark1Time
put 0 into totalClear1Time
put 0 into totalMarkTime
put 0 into totalClearTime
set cursor to watch
set the numberFormat to "#.00000"
repeat 1000
subtract the ticks from totalMark1Time
set the mark of card card2Mark to true
add the ticks to totalMark1Time
subtract the ticks from totalClear1Time
unmark all cards
add the ticks to totalClear1Time
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
set cursor to hand
put (targetStack&":"&return&cardCount&&"cards"&return& \
(totalMark1Time/1000)&&(totalClear1Time/1000)&& \
(totalMarkTime/1000)&&(totalClearTime/1000)) into \
field "Test Results"
end mouseUp
Results: Cards Mark1 Unmark1 Mark Any Unmark Any
147 .001 .000 .000 .001
6177 .086 .084 .114 .070
43046 .473 .667 .662 .642
(Running the test multiple times produces results within a range of
about +_.005)
Looks to me like the impact of stack size is lessened by selecting a
specific card, but the time still varies directly by stack
size...just at a different ratio. If these results are consistent,
it takes 400-500 times as long to mark a specific card in a 43K+ card
stack as it does to mark a specific card in a 147 card stack.
Perhaps one might ask, "What is the effect of marking the 41st card
from the end rather than marking the same card (ie: 1-147 in this
test)?" My answer, "Try it and see: I've found out what I wanted to
know."
...though I'm still left with the issue of whether it is more
efficient to take the time to mark & unmark cards within my search
range or let a find command potentially search the entire database
stack when I'm only interested in 5% of the cards or less. That
calls for more tests at another time--perhaps even conditional logic
that does or doesn't mark depending on the scope of the search.
Final note: My original query asked whether there was an efficient
means of searching a database stack remotely (ie: without actually
going to the stack). Since, AFAIK, one can only deal with the mark
property of a card in the current stack ("get the mark of card x of
stack y" produces compiler errors here), the answer to my original
question seems to be "No."
--
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