[Prev][Next][Index][Thread]
Fun-O Basic Edition Compiler
This is really a question about the Fun-O implementation, not Dylan in
general, so I apologise to the GD correspondents.
I've downloaded the latest Basic Edition, and compiled some simple tests
in the Playground (i.e., Listener or Interactor).
One is the Takeuchi benchmark. When I run this, is seems, well, very
slow. 2000 iterations of this take over 10 seconds to complete on a 1.1
GHz Athlon. The same 2000 iterations, on the same machine run in about 2
seconds when compiled under Corman Lisp.
Is there something I'm missing? I would think that the compiler would
have all the information it needs to optimize Tak, since it's defined as
taking 3 <integer> args and returning an <integer>. Does the Basic
Edition not do certain optimizations?
I've been led to believe that Tak is a pure function call benchmark,
and, as I assume that any Dylan implementation would be doing lots of
function calls, it should be pretty speedy - at least as speedy as a
Common Lisp compiler.
Anyway, please let me know what I'm doing wrong. I'm typing this from
memory, so please forgive any typos - the version I ran is correct and
returns 7 for tak(18, 12, 6).
define method tak( x :: <integer>, y :: <integer>, z :: <integer>) =>
(result :: <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 method tak;
define method tak-times(n :: <integer>) => ()
for (index from 1 to n)
tak(18, 12, 6);
end for;
end method tak-times;
invoked as:
tak-times(2000);
in the Dylan Playground (i.e., interactor).
Thanks for any help,
Raf
Follow-Ups:
References: