Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Not a flood of responses here :) but apparently some interest, so I'll try to answer my own question with what I've learned over the past few days:</p> <ul> <li>With the 1.1 optimization approach (Java primitives and mutable arrays) ~4x slower than optimized Java is about as fast as it goes. </li> <li>The 1.2 constructs <code>definterface</code> and <code>deftype</code> are <strong>more than twice as fast</strong>, coming within ~1.7x (+70%) of Java with shorter, simpler and cleaner code than for 1.1.</li> </ul> <p>Here are the implementations:</p> <ul> <li><a href="http://github.com/j-g-faustus/Clojure-test-code/blob/master/shootout/nbody.clj" rel="noreferrer">Clojure 1.1 approach</a></li> <li><a href="http://github.com/j-g-faustus/Clojure-test-code/blob/master/shootout/nbody_type.clj" rel="noreferrer">Clojure 1.2 approach</a></li> </ul> <p><a href="http://wiki.github.com/j-g-faustus/Clojure-test-code/" rel="noreferrer">More details</a> including "lessons learned", JVM version and profiling screenshots.</p> <p>Subjectively speaking, optimizing the 1.2 code was a breeze compared to optimizing 1.1, so this is very good news for Clojure number crunching. (Actually close to amazing :)</p> <p>The 1.2 testing used the current master branch, I did not try any of the new numeric branches. From what I can gather the new ideas currently being discussed </p> <ul> <li>may make non-optimized numerics faster</li> <li>may speed up the 1.1 version of this benchmark</li> <li>will probably not speed up the 1.2 version, it is already as "close to the metal" as it is likely to get.</li> </ul> <p><strong>Disclaimers:</strong></p> <ul> <li>Clojure 1.2 is not released yet, so 1.2 benchmark results are preliminary.</li> <li>This is one particular benchmark on physics calculations. It is relevant to floating point number crunching, but irrelevant to performance in areas like string parsing, concurrency or web request handling.</li> </ul>
    singulars
    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.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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