This is the mail archive of the kawa@sourceware.cygnus.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Bugs and Optimizations


Mark DePristo <m-depristo@nwu.edu> writes:

> Right now, the JVM and C backends are the most stable and support R4RS 
> Scheme minus continuations.  The C backend is a little bit (2x) slower 
> than Bigloo.  The JVM backend is 10x faster than Kawa 1.6.1 and 25-30% 
> faster than Kawa 1.6.66.  

Hm.  Only 25-30% faster than the latest Kawa.  I don't feel too bad
then, especially since Kawa is strong in pragmatics (full numeric
rower, Java integration, module system, etc).  Still, there is no
doubt Kawa can be made to generate better code.  Better use of
primitive arithmetic would certainly help, for example.

> I'll happily post this information in a couple of weeks, as soon as
> everything is stable.  It would be really helpful if I could get the
> DERIV benchmark running on Kawa 1.6.66, before I post the
> information/submit for publication.  

Right now I'm trying to beef up Kawa modules, so things are a bit
unstable.  I willtry to get the deriv benchmark running as soon as things
are stable again, hopefully in a few days.

> BTW: How do you guys do tailcalls on the JVM?  We are using a
> trampolining mechanism that appears faster than whatever you are
> doing.  Our method, however, requires that the entire system be
> compiled with full tailcall support.  How does Kawa handle tailcalls?

All Kawa procedures, whether compiled for tailcalls or not, are
sub-classes of gnu.mapping.Procedure.  Procedure that are compiled
with full tail-call support are sub-classes of CpsProcedure, which
is an indirect subclass of Procedure.  When a CpsProcedure calls
another procedure, it leaves the called procedure on the trampoline
manager (a CallStack object).  The trampoline then calls the
new procedure's apply(CallStack) method.  If that procedure is
a CpsProcedure, then tail-calls work just fine.  If it is regular
procedure, then the default implementation of apply(CallStack)
just calls the regular non-trampolined applyN(Object[]).

Ifa regular procedure calls a CpsProcedure, then the latter's
applyN(Object[]) method will allocate a new CallStack, and then
call the latter's apply(CallStack) until done.

I haven't tried too hard to optimize CpsProcedure handling,
partly because most Kawa users don't seem to care, and partly
if I'm going to spend the time I might as well also get
full call/cc working.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/~per/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]