From: draper@odin.mda.uth.tmc.edu (E.J. Draper)
Newsgroups: comp.sys.mac.hypercard
Subject: Re: Script speed questions
Date: 7 Oct 1992 20:27:34 GMT
Organization: U.T.M.D. Anderson Cancer Center
X-UserAgent: Nuntius v1.1.1d12
X-XXMessage-ID: <A6F8B250EA02019A@mdarpi1.mda.uth.tmc.edu>
X-XXDate: Wed, 7 Oct 92 15:27:12 GMT

In article <1992Oct6.153510.22591@panix.com> Dany Drennan,
xixax@panix.com writes:
>Well, I beg to differ. I was dealing with the exact same problem; i
needed
>to create a reference file of all cards: in the end, by going to each
>card, i cut a good 15 minutes off of the total time involved--my stack
had
>700 cards in it.
>
>In any case, I will get the definitive answer from Chris Watson and
repost
>it here... 

Well excuse ME but I beg to differ. Here's some data to illustrate my
point:

SCRIPT:
on mouseUp
  ------------> Go to each card in the background
  lock screen 
  Set lockMessages to true
  Put the Ticks into startTicks
  repeat with x = 1 to the number of cds in this bg
    go cd x
    put fld "File Name" & return after CollectedFileNames
  end repeat
  Put the Ticks into EndTicks
  Put "Go to each card completed in:" && EndTicks - StartTicks &&
"ticks." & return into Times
  ------------> Reference each card in the background
  Put the Ticks into startTicks
  repeat with x = 1 to the number of cds in this bg
    put fld "File Name" of cd x of this bg & return after
CollectedFileNames
  end repeat
  Put the Ticks into EndTicks
  Put "Refer to each completed in:" && EndTicks - StartTicks && "ticks."
After Times
  Answer Times
end mouseUp

CONFIGURATION:
Quadra 700
3500K Heap Size
96K Cache
System 7.01 + Tuned (1.1.1)
HyperCard 2.1
307 cards in background


RESULTS:
3 runs

            GO CARD          REFERENCE CARD
RUN #1        300                185
RUN #2        270                158
RUN #3        306                212

Average:      292                185

(All times in ticks)

After (Compacting Stack)
            GO CARD          REFERENCE CARD
RUN #1        459                197
RUN #2        291                196
RUN #3        293                194

Average:      347                195

I could up the number of samples but you can be assured it would be more
of the same.  As for SuperCard I cannot speak, I don't have a copy in
which to benchmark.  As a SuperCard engineer Chris can speak
definitively. However Chris Watson cannot speak definitively concerning
HyperCard.  While he's an expert HyperCard scriptor (and an all round
cool dude) he's not on the HyperCard team and is not privy to the nuts
and bolts of HyperCard.  

Thus the following seems to make sense: 

(from page 498 of the _HyperCard Script Language Guide_)
"Referring to a remote card is generally faster than going there, but is
dependent on the number of fields referred to per card.  For example,
when collecting data from fewer then 10 fields, referring to a remote
card in the current stack is faster than going to the card.  On the other
hand, when collecting data from 10 fields or more, it is faster to go to
that card and collect the data."


      |E|J-  ED DRAPER
 rEpar|D|<-  Radiologic/Pathologic Institute
             The University of Texas M.D. Anderson Cancer Center
             draper@odin.mda.uth.tmc.edu