[comp.sys.mac.hypercard] Compiled HC code

stone@hydra.unm.edu (Andrew Stone CS.DEPT) (03/12/89)

In article <75141GFX@PSUVM> GFX@PSUVM.BITNET writes:
>>I think that now, that HyperTalk
>
>Do I understand that it is now possible to compile some scripts (eg. functions)
>written in HyperTalk (that's the name of the language used in HC, right?).
>
>Where can we get more information?  How much faster does it execute?  Stephane

I bought CompileIt at MacWorld Expo. It took it 30 minutes to compile this line
of code:

put X + (cos(theta)) into newX

That was the entire function. The XFCN generated operates at at half the speed 
of the normal hypertalk code! That is, the XFCN takes twice as long!

You decide if its worth $99 or whatever dollars.

||<<++>>||<<-->>||<<==>>||<<++>>||<<??>>||<<++>>||<<-->>||<<==>>||<<++>>||
||	   Andrew Stone	            ??		2 + 2 = 5;		|| 
||         stone@hydra.unm.edu	    <> 	    for sufficiently large 2    ||
||<<++>>||<<-->>||<<==>>||<<++>>||<<??>>||<<++>>||<<-->>||<<==>>||<<++>>||

biling@ucscd.UCSC.EDU (Doug Rosener) (03/12/89)

In article <4634@charon.unm.edu> stone@hydra.unm.edu.UUCP (Andrew Stone CS.DEPT) writes:
>
>I bought CompileIt at MacWorld Expo. It took it 30 minutes to compile this line
>of code:
>
>put X + (cos(theta)) into newX
>
>That was the entire function. The XFCN generated operates at at half the speed 
>of the normal hypertalk code! That is, the XFCN takes twice as long!
>
>You decide if its worth $99 or whatever dollars.

I'm probably wrong, but I think you did the worst test possible.  If you
only compile one command, then you will see mainly the overhead costs.

However, if you took a large number of commands and compiled them, the 
savings begins to outweigh the time in executing the XFCN

You probably tried this, but compiled code usually runs faster than
interpreting.

Doug Rosener

GFX@PSUVM.BITNET (03/12/89)

I had written a set of HC matrix operators last year and will gladly send it
to anyone who would like to volunteer to compile and benchmark the execution
speed.  The interpreted version works but is so slow that it is totally useless
for anykind of application beside demonstrating a regression procedure, step
by step.  I am very curious as to whether compiled HC code can provide a
feasible alternative to XFCNs.  (I'd send a 9K Binhexed mono-card stack)
Stephane

shani@TAURUS.BITNET (03/13/89)

In article <4634@charon.unm.edu>, stone@hydra.unm.edu.BITNET writes:
> of the normal hypertalk code! That is, the XFCN takes twice as long!
>
> You decide if its worth $99 or whatever dollars.
>
Is that so???

Looks like a bug for me! that is, it must be a bug! nobody seriously means a
compiler to create a slower code!

anyway, the compiler I know of, is made by apple. I will have it testrunned
soon, and then I will post about it

O.S.

stadler@Apple.COM (Andy Stadler) (03/14/89)

In article <4634@charon.unm.edu> stone@hydra.unm.edu.UUCP
 (Andrew Stone CS.DEPT) writes:
>
>I bought CompileIt at MacWorld Expo. It took it 30 minutes to compile this line
>of code:
>
>put X + (cos(theta)) into newX
>
>That was the entire function. The XFCN generated operates at at half the speed 
>of the normal hypertalk code! That is, the XFCN takes twice as long!
>

The problem with this test is that probably 99% of the execution is inside
SANE (the Mac's math package) and compiling won't make a difference.  But
compiling does add the overhead of jumping in and out of the XCMD, probably
a string -> extended floating point conversion, etc, etc.

I spent some time at the show talking to the CompileIt people.  The real
wins come if you can write code which stays inside the compiled XCMD as
much as possible, avoiding the overhead of jumping in-and-out.

--Andy

(No endorsements either way, I haven't even tried the darn thing)