Note that there are some explanatory texts on larger screens.

plurals
  1. POClojure number crunching performance
    primarykey
    data
    text
    <p>I'm not sure whether this belongs on StackOverflow or in the Clojure Google group. But the group seems to be busy discussing <a href="http://groups.google.com/group/clojure/browse_thread/thread/c8c850595c91cc11/171cacba292a0583?q=primitive+support&amp;lnk=ol&amp;" rel="noreferrer">numeric improvements for Clojure 1.2</a>, so I'll try here:</p> <p><a href="http://shootout.alioth.debian.org/" rel="noreferrer">http://shootout.alioth.debian.org/</a> has a number of performance benchmarks for various languages. </p> <p>I noticed that Clojure was missing, so I made a Clojure version of the <a href="http://shootout.alioth.debian.org/u32q/benchmark.php?test=nbody&amp;lang=all" rel="noreferrer">n-body problem</a>.</p> <p>The fastest code I was able to produce can be <a href="http://github.com/j-g-faustus/Clojure-test-code/blob/master/shootout/nbody.clj" rel="noreferrer">found here</a>, and benchmarking it seems to be saying that for number crunching Clojure is</p> <ul> <li>factor ~10 quicker than Python/Ruby/Perl</li> <li>factor ~4 slower than C/Java/Scala/Ada</li> <li>approximately on par with OCaml, Erlang and Go</li> </ul> <p>I'm quite happy with that level of performance.</p> <p>My question to the Clojure gurus is</p> <ul> <li>Are there obvious improvements I have missed, either in terms of speed or in terms of code brevity or readability (without sacrificing speed)?</li> <li>Do you consider this to be representative of Clojure performance vs Python/Ruby/Perl on one hand and Java/C on the other?</li> </ul> <p><strong>Update</strong></p> <p>More Clojure 1.1 benchmark programs for the shootout <a href="http://github.com/jafingerhut/clojure-benchmarks" rel="noreferrer">here</a>, including the n-body problem.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload