[Prev][Next][Index][Thread]
Re: Fun-O Basic Edition Compiler
Scott McKay wrote:
>
> "Scott McKay" <swm@mediaone.net> wrote in message
> iQkW7.39099$5W5.14789627@typhoon.ne.mediaone.net">news:iQkW7.39099$5W5.14789627@typhoon.ne.mediaone.net...
> >
> > "Carl Gay" <carlgay@mediaone.net> wrote in message
> > 3C2938A6.4242FE86@mediaone.net">news:3C2938A6.4242FE86@mediaone.net...
> >
> > >
> > > define method tak (x :: <integer>, y :: <integer>, z :: <integer>)
> > > if (y >= x)
> > > z
> > > else
> > > tak(tak(x - 1, y, z),
> > > tak(y - 1, z, x),
> > > tak(z - 1, x, y))
> > > end if
> > > end;
> > >
> >
> > Try adding '=> (r :: <integer>)' as the return result of 'tak'. I'll bet
> > that your use of the implicit return type of <object> is defeating some
> > of FD's optimizations.
> >
> >
>
> Oh, and the timing loop should be for (i :: <integer> from 0 below 2000).
Actually FunDev gets this right (according to dispatch coloring)
even without the type decl in this case. I vaguely remember
this optimization being added back at Harlequin since it's so
common to do a loop with constant limits.
> You should add a fixnum decl to the Lisp code, too.
>
> Then you'll be comparing apples to apples in all the code, because the
> Java code is fully typed as 'int'...
I wrote:
> FunDev Lispworks Java Java
> Prod Mode static[1]
> ---------------------------------------------
> 11.314s 6.8s 4.297s 3.795s
> 1.0 1.7x 2.6x 3.0x
New numbers after adding a return type decl to the Dylan
code:
FunDev Lispworks Java
8.343s 6.8s 4.297s
1.0 1.2x 1.9x
Follow-Ups:
References: