[comp.sys.mac.hypercard] Mark/Unmark Speed

dmittman@beowulf.JPL.NASA.GOV (David Mittman) (11/30/90)

For all you HyperCard gurus out there, when is it faster to use
"unmark all cards" as opposed to:

    repeat with x = 1 to number of cards
      unmark card x
    end repeat

I seem to be having difficulty deciding which way to unmark cards
when I have 10 out of 800 mark as opposed to having 600 out of 800
marked. At what point is one way better than the other?

					- David Mittman
					DMittman@Beowulf.JPL.NASA.GOV

gandalf@apple.com (Martin Gannholm) (12/01/90)

In article <10587@jpl-devvax.JPL.NASA.GOV> dmittman@beowulf.JPL.NASA.GOV 
(David Mittman) writes:
> For all you HyperCard gurus out there, when is it faster to use
> "unmark all cards" as opposed to:
> 
>     repeat with x = 1 to number of cards
>       unmark card x
>     end repeat

There was a "slight" bug in HyperCard 2.0 that caused the HyperTalk 
statement "unmark all cards" to be quite slow. In fact, it was so slow 
that I decided to speed it up a bit in 2.0v2.

HyperCard was doing a _lot_ of work going to each card before unmarking 
it. My test stack, consisting of approx. 9000 cards now takes 9 seconds to 
unmark all the cards (on my IIci w/cache & RAM disk), regardless of how 
many are actually marked, i.e. linear speed increase.
  I tried 2.0 with the same test, and after 40 minutes I gave up -- it had 
only done approx. 1/5 of the work. The more cards you had the worse 
performance you got. In fact, the script above should always be faster in 
2.0 than actually using the unmark all command.


Martin Gannholm
HyperCard 2.0 Engineer
Apple Computer

Exclaimer!!!   I typed this myself = I speak for myself...
..or..I never said it...Nobody heard me say it...You can't prove anything!