On Dec 14, 9:01 am, Mike Perham <mper...@gmail.com> wrote:
> Hi, I'm just learning Clojure but I thought I would do a little
> experiment to see where Clojure sits performance-wise compared to a
> number of other languages on the old Fibonacci sequence.  I think it
> handles itself quite well.
>
> The full writeup:http://www.mikeperham.com/2008/12/13/clojure-vs-ruby/
>
> The results:
> Java                          1.2 sec
> C (gcc 4.0.1)             2.6 sec
> Clojure 20080916     11.3 sec
> Ruby 1.9pr1          44.3 sec
> JRuby 1.1.5         118.1 sec
> Ruby 1.8.6          195.6 sec
>
> Java's native speed is outstanding and while Clojure adds some
> language overhead, the benefits of running on the JVM are obvious.
>
In your article, you mentioned running "native" -- you should probably
use Clojure's AOT to get a valid comparison. And provide type hints so
that it uses the same numerical types to perform the computation -- by
default, Clojure, like most other Lisps, have arbitrary-precision
integers, and have to do BigInt conversion behind the scene.

Chez Scheme 7.4 (Pentium 4 3.2 GHz, using only one thread) takes
12.134 s with a straight implementation of your code (and 0 ms with an
iterative version), so on your machine, Clojure is performing
decently. What's your exact set-up? (machine type, how the code is
compiled, etc.)

--
Michel

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to