Designing an appliaction and improving it's performance can be tricky with Clojure. In spirit of overcoming that difficulty here are some resources to aid you in developing a higher performance application.
Edit: The Clojure benchmarks are up on the Benchmarks Game. I have made this question community wiki and invite others to keep it updated. Is anyone aware of benchmarks of Clojure's performance? I have done some of my own (although nothing too formal) and it didn't fair too well in comparison to other functional languages (tried Haskell and OCaml). But how does it look compared to Java or another language on the JVM (e.g. Scala)? And how does it compare to other Lisps? There was some discussion on the Computer Language Benchmarks Game forum about adding Clojure on there, but nothing has been done yet. Edit: I'm going to continue to add to this as I find more: @igouy pointed out that the benchmark scripts for clojure are being created by jafingerhut on github. Two very relevant threads from the Clojure discussion group: Clojure performance tests and clojure a little slower than Java Clojure speed Fibonacci function performance compare between clojure and scala And separately, these blog posts: Basic Clojure, Java and JVM Language performance Scala Vs Clojure???Let?s get down to business and Scala vs Clojure???Round 2: Concurrency! Python vs Clojure???Evolving and Python vs Clojure???Reloaded Clojure vs. Ruby Clojure Discussion - When Performance Matters Clojure vs Ruby & Scala???Transient Newsgroups And lastly, a related question on stackoverflow: On Performance and Java Interoperability: Clojure vs. Scala Most of these discussions lead me to think that Clojure's performance is very favorable in comparison to other languages running on the JVM, although there is no doubt that it can be very difficult to come to a broad conclusion when comparing languages because their performance can vary dramatically dependent on the task. Edit: Lau Jensen just posted a great discussion about benchmarking with JVM languages on his blog: "Getting benchmarking right".
Edit: This post recently re-surfaced on hacker news and caused a bit of a stir, mainly because of a slightly sensational/misleading title (was "Why is Clojure so slow?"). I wrote this before Rich Hickey's Clojure/Conj 2011 keynote was published, in which he talks about most of my concerns (and outlines possible solutions).
Some weeks ago, Lau Jensen implemented Brian’s Brain but gave up making it go faster. He reached for my advice but I was swamped in work. (defn neighbours-count [rows i w] (count (for [j [(mod (inc i) w) i (mod (dec i) w)] r rows :when (= :on (r j))] r))) (defn step1 [rows] (let [current (second rows) w (count current)] (loop [i (dec w), row (transient current)] (if (neg?
System (nanoTime)) ret# ( ~@expr (/ 1.0 ~its) ~its ) finish# (.
In the past few weeks, I've been tasked with implementing my tic-tac-toe program in Clojure. Since I'd already written a working game in Ruby, this was really more of an exercise to pick up Clojure...
If this isn't a Zawinski quote, it should be. I have avoided the JVM my entire life. I am presently confronted with problems which fit in the JVM; JVM libraries, concurrency, giant data: all that g...
There are a few overlooked areas when trying to find and murder slow code, besides the regular offenders: accidental reflection, IO/logging, and doing too much work. Here are a few lessons. But first: Complexity is the perpetual wolf outside the door. Performant code can easily obscure intent and harm clarity.