开发者

What is the most performant lisp on the JVM

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, Sche开发者_Python百科me, 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.


With Clojure you can get to the speed of Java (with type hints of 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.


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 :)


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.


I've been testing various lisps over the last few weeks. Kawa is the fastest JVM implementation I've tried so far in terms of startup time, REPL response time and running basic scripts. The author posted some performance statistics in 2010, which shows that Kawa outperforms clojure by a clear margin. YMMV.

http://per.bothner.com/blog/2010/Kawa-in-shootout/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜