[comp.sys.mac.hypercard] Speed Degradation, Some Questions

martin@ti-csl.CSNET (Steven Martin) (01/04/88)

I've been dealing with a stack of 5000+ cards that takes up about 3meg
and thought I'd post some observations about speed.

I'm running a Mac II with 1Mb (3 more on order).  The RAM Cache is on
with 194K.

Times are based on 1-2 tests around the last 10 cards of the stack and
were timed with a digital watch.

First of all the good news:

1) 'go to card x' where x is a NUMBER is still plenty fast (less than
   1 second)

2) 'get field y of card x' where x is again a number is also plenty
   fast (less than 1 second).

Now the bad news:

1) 'set the name of this card to "foo"' gets real slow (about 18
   seconds) toward the end of the stack. 

2) 'pop card' where the destination is toward the end of the stack is
   quite slow (up to 15 seconds within the same stack)

3) 'find "x"'. If you do this from the beginning of the stack it is
   fast as usual toward the beginning.  If you are toward the end of
   the stack there is a ~7 second pause before cursor changes to
   a beachball, searching looks like it is just as fast as usual, then
   there is a ~10 second pause before the destination card is
   displayed. 

It looks to me like any kind of "go to card x" where x is a card id or
card name gets extremely slow (linear search?).  POP and FIND must be
using this kind of "GO".

I keep the stack sorted and use a binary search (get field x of card x
is still fast!) in order to quickly go to a card.  That solves the
problem of getting to a certain card.

QUESTIONS!

I often have to find all occurrences of a certain phrase in the stack.
This is a problem since the finds get real slow toward the end. Any
ideas?

If you have a function that is applied to its arguments while in one
stack but is referred to by a script in another stack like:

...
push card
go to stack "foo"
repeat with x = 1 to number of cards
  go next card
  function()
end repeat
pop card
...

Is there a way to avoid thrashing back and forth between the two
stacks?  It seems to thrash sometimes and not others but I haven't
figured out why.

Thanx in advance for any help.

-- 
Steve Martin            USENET: {ctvax,im4u,texsun,rice}!ti-csl!martin
                        PHONE: (214)-995-5919, 691-1450
If you think of something, it exists somewhere.

john@felix.UUCP (John Gilbert) (01/12/88)

In article <39262@ti-csl> martin@ti-csl writes:
>
>QUESTIONS!
>
>If you have a function that is applied to its arguments while in one
>stack but is referred to by a script in another stack like:
>
>...
>push card
>go to stack "foo"
>repeat with x = 1 to number of cards
>  go next card
>  function()
>end repeat
>pop card
>...
>
>Is there a way to avoid thrashing back and forth between the two
>stacks?  It seems to thrash sometimes and not others but I haven't
>figured out why.
>

If this is for your own personal use at home, then you can move the
function to your home stack, where reference from any stack should find
it.

However, if you are creating stacks you want to ship to others, this presents
some obvious problems.  I am wondering if anyone out there is distributing
HyperCard stacks, and has found an easy way to manage this.  In particular,
I have some XFCNs that I would like shared by several stacks, and feel 
too cheap to add them to each stack.  This becomes even more important for
some sound resources I am including, which are really large.  At the moment
I go one particular stack to play them.

How do folks deal with resources shared among stacks they want to distribute?
I have thought about providing an XCMD to install things into the Home stack,
but this seems a bit presumptuous on my part.

In short, I am quite reluctant to put anything I want to deliver to others
anywhere but in the individual stacks that use them.  Any comments?

John Gilbert


--
John Gilbert
!trwrb!felix!john