home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.hypercard
- Path: sparky!uunet!cs.utexas.edu!wupost!csus.edu!netcom.com!boserj
- From: boserj@netcom.com (Jeffrey Boser)
- Subject: Re: How magic is the CompileIt?
- Message-ID: <8b8m0jb.boserj@netcom.com>
- Date: Sun, 16 Aug 92 05:53:23 GMT
- Organization: Netcom - Online Communication Services (408 241-9760 guest)
- References: <15AUG199209103159@oregon.uoregon.edu> <1992Aug16.033156.6692@reed.edu>
- Lines: 33
-
- sharvy@reed.edu (V Headshape) writes:
- > I thought HC 2.0 compiled scripts on its first execution of them and
- >stashed them in RAM, so why would compileIt be faster? At least, why
- >would it be 50 times faster?
-
- Well, there are some problems here. First off, Hypercard is
- pretty funky when it comes to memory, and the compiled handlers
- are all purgeable, so the first memory allocation wipes them.
- so this means that they can only hang around for a little while,
- and only one at a time. So its not like its compiled and every
- time thereafter you call it, it will be already compiled.
-
- Now, me and a few associates hit this problem. Get this.. what
- if you want almost immediate response time from a handler, every
- time you call it? Well, got news for ya, loading the script,
- finding the handler, extracting it, compiling it, all take time.
- So, what we did was use compile the big handler into an xfcn,
- then used ResEdit to mark it to load in when the stack was opened.
- Resulting in very fast response, as hypercard only had to figure
- out the calling script and go to teh xfcn. This was a big deal
- in that this handler reacted to mouse-presses, and a long delay
- before the reaction happened was unacceptable (We got a thousand
- percent improvement in speed... making what it acceptable).
-
- Also, depending on *how* your compiled xfcn handles data, there can
- be another improvement. Your xfcn may take advantage of FPU, or
- streamline some functions like assignment and arithmetic... hypercard
- is pretty generic, and hence pretty slow in the specific.
-
- And.. when it comes right down to it.. if you want response,
- hard code the bugger...
-
- ....jeff
-