views:

328

answers:

3

What is the most performant (fastest) lisp implementation on the JVM? By lisp implementation I consider all implementations of any language in lisp family, like Common Lisp, Scheme, Clojure, ...

I know that Clojure can be made pretty fast using type hints, that ABCL is in general not considered to be fast. I don't have experience using any Scheme on JVM, but heard that Kawa is pretty fast too.

+7  A: 

not a whole lot of good data though this and some others seem to indicate the obvious. Immutible languages suffer slightly when doing non-immutable tasks, and non-immutable languages suffer when doing highly parallel tasks.

When considering these questions it helps to consider the "fail back option". Clojure can fall back to java for any part of your code that the profiler tells you is not pulling its wight.

in short: I vote clojure :)

Arthur Ulfeldt
+2  A: 

I'd be surprised if it is not clojure. No other JVM lisp I know of has had as much attention paid to performance. The fastest Scheme is probably SISC - it's compiled to a FASL format, but still not "native" JVM instruction level.

p-lo
SISC stands for "Second *Interpreter* of Scheme Code", for an interpreter its performance is considered quite good, but its definitely slower than kawa, which compiles directly to bytecode and also supports type hints. A comparison between clojure and kawa performance could be interesting however.
Jörn Horstmann
+5  A: 

With Clojure you can get to the speed of Java (with type hints off course) and you can not get faster than java (exept in some very rare cases). I don't know about the other lisps the are maybe the same speed but not faster.

So that said about the standard speed of calls and so on.

Clojure has data structures are not always as fast as possible but the really make up for that with there other properties like thread safety, immutable and fast reading.

To make the data structures faster Rich invented transient with make them mutable in a way that they are still functional (and the are a LOT faster) and he is already working on the next big thing (read about the Emerging Languages camp talk of rich).

Its much easier to write concurrent code with clojure so that is really imported for to make fast programmes.

So the next thing is math. There are three levels of Speed on the JVM. Math with boxed Types,primitiv Types with overflow checking,or without overflow checking. Clojure provides all of those so no limit there.

So the next thing is how fast can you work with Java, if you have to use wrappers you wont perform as good and java calls are used often in most JVM languages. To implement clojure in clojure, clojure needed to add a low level construct so that you can interact with java without any overhead.

So clojure is as fast as it gets on the JVM.

P.S.

Protocols are like really fast multmethods witch are not that generic but the dispatch fast enough to use them in clojure core (and so not depend on java anymore). Look them up the are way cool.

nickik