Home | Articles Index

 

HyperCard Speed Tips

by Robert Howe and Laura Lunetta

 

America Online's HyperCard Forum periodically holds scripting conferences in which HyperCard-related topics are examined in detail. In most cases, a HyperCard expert prepares a topic stack for members to download and study before the conference discussion.
One of the most popular of these conferences was one held in 1995 on the topic of improving HyperCard's speed. Robert Howe, who co-authored the conference stack, graciously agreed to update his stack especially for HyperCard Heaven and to let us post portions of it here as a text article.
The stack contains tips to enhance the operating speed of HyperCard stacks, based on information from published sources and suggestions from HyperCard experts. It is perhaps the best single reference source on this important subject.
Robert is a computer programer who works on mainframes for the state of California, but he says he'd much rather be programming a Mac. He's a member of "The Wheelmen," a national organization that's "dedicated to the enjoyment and preservation of our cycling heritage." His photo, taken at Yosemite in 1986, shows Robert and his 54-inch 1888 Columbia Expert.
You can read more about Robert and The Wheelmen at his web site. Robert will be moving his site soon from [old site] to [new site].

Download Stack

"HyperCard Speed Tips"
130 K download, compressed with Stuffit, requires HC 2.0

The Speed Tips stack contains the text below plus numerous timed speed demos. The stack may be freely distributed as long as you don't alter it or charge for it. You can find a great collection of other scripting conference stacks at Jacqueline Gay's HyperActive web site.

 


 

f you have a one-time utility handler, you probably don't care if it takes two minutes to run, especially if it would take you five more minutes to speed it up to make it run in half a minute! However, if there is a handler you use frequently, spending a little time to speed it up is well worth the effort.
I've classified speed improvement methods into five categories:

1) Reduce disk access
2) Code efficiently
3) Compile code
4) Workaround limitations
5) Smoke and Mirrors

Most of these (but not all!) are described in both the HyperCard Script Language Guide (for HC 2.2: see pages 555 - 560), and HyperTalk 2.2: The Book (pages 39 to 54). These two books are my primary references for this scripting topic stack, along with my (Robert) hard-earned experience and the helpful advice of AOL HyperCard Mentors Brian Molyneau and Brett Sher.
I'm going to describe the methods of improving HyperCard's speed. If you download the companion stack you can run demos which show you what you can expect in the way of time savings.

 

1. Reduce Disk Access

HyperCard is a disk-based application. That is, some of your stack is held in memory at any time; most of it stays on your hard disk. Allocating more memory to HyperCard (via the Finder's "Get Info" window) allows HyperCard to keep more of your stack in memory. For the record: disks are slow, memory is fast.
The alternative to increasing HC's memory allocation (or using a RAM disk) is to reduce the activities that cause HC to access the disk.

a) You keep all related data in the same stack. (Use different backgrounds when appropriate.)

b) If you must go to another stack, get all the information that you think you'll need in just one trip.

Timed examples are presented in the "HyperCard Speed" stack.

 

2. Use Efficient Coding Techniques

Fast languages can be crippled by inefficient coding. Technically speaking, slow languages cannot be made any faster through efficient techniques-but efficient techniques will make them appear faster. HyperTalk's speed is actually quite sufficient for most uses as long as it isn't hindered by inefficient techniques!

The standard efficient coding techniques (described in the HC manual), are:

Some techniques specific to HyperCard (also described in the HC manual), are:

Some of these techniques perform better than others. Timed examples are presented in the "HyperCard Speed" stack.

continued on next page

 

HyperCard Heaven
http://members.aol.com/hcheaven/
This page was last modified on February 9, 1997