8 ms·
http://shootout.alioth.debian.org/u64q/benchmark.php?test=all&lang=clojure&lang2=yarv http://shootout.alioth.debian.org/u64q/benchmark.php?test=al... Median sp
by dons 14y ago
http://shootout.alioth.debian.org/u64q/benchmark.php?test=all&lang=clojure&lang2=yarv http://shootout.alioth.debian.org/u64q/benchmark.php?test=al...
Median speedup for the same problem in Clojure was 12x over Ruby. and 14x for Haskell; ... and 25x in Java .. and 35x in C++...
- dsabanin 14y agoUnfortunately the cost of developing this solution in C++ would be forbidding for us. In our case on the pretty much same loop the difference between Ruby and Clojure was 20-30 times. Please note that using Clojure allowed us direct access to Java libraries, so essentially this is Java performance that we've been able to tap into using Clojure.
- sandGorgon 14y agodid you try doing the same using jruby?
- dsabanin 14y agoNope. Although JRuby is not very efficient in calling Java code, at least it's not as efficient as Clojure is from what I've read. Another plus for Clojure is that it allows us to easily have a multi-threaded implementation. JRuby allows native threads too, but Clojure make concurrency really easy, while JRuby just wraps Java threads with nothing more, so I would have to use regular locking and stuff.
- swannodette 14y agoAlioth benchmarks are out of date as far as Clojure is concerned. These days it's not much work to get Clojure to deliver identical to Java performance. Better versions of the same benchmarks here that show the same performance as Java that you verify yourself - http://github.com/clojure/test.benchmark http://github.com/clojure/test.benchmark
- Arare 14y ago"The Computer Language Benchmarks Game" has never been a valid benchmark for any language or implementation.
- igouy 14y agoWhy?
- lrem 14y agoAmong others: because of completely arbitrary and I'd dare to say weird rules. Programs are not meant to be written in idiomatic language. They are meant to resemble the C implementation. In many cases you can see that the program representing the language in the comparison is neither the fastest nor the simplest of the submissions.
- igouy 14y agoYou've made a bunch of claims without showing any evidence to support them. Please point to specific examples we can all look at on the website which show -- "Programs are not meant to be..." -- which show -- "They are meant to resemble the C implementation." etc
- lrem 14y agoI'm not going to back up these claims in any other way than pointing the "interesting alternative" programs that appear in some comparisons, which tend to be faster than the chosen versions. For example here: http://shootout.alioth.debian.org/u64q/benchmark.php?test=fannkuchredux&lang=all http://shootout.alioth.debian.org/u64q/benchmark.php?test=fa... Both Lisp and Java alternatives are faster than the "fastest" solution (written in Fortran). Finding any more support for the years-old opinion I voiced seems too much work to be worth it.
- igouy 14y ago