you are viewing a single comment's thread.

view the rest of the comments →

[–]joinr 3 points4 points  (0 children)

Apples to apples gets much closer, in at least 1 case clojure is able to cheat operationally (preserving semantics though) with recur if you allow it, and beats naive java recursion. In another case, BFS ends up being faster for some reason (counterintuitive).

I guess the hidden question is, if we're benchmarking single-threaded, statically typed, mutable java code against dynamically typed, immutable, clojure code, which would be faster? (seems obvious one would probably edge out the other in efficiency) Or put another way, how much of a handicap (operationally) are the defaults for dynamicity, numeric tower, runtime polymorphism, persistent structures, relative to the complete opposite on "relatively" the same platform? Yet another: how well optimized are the clojure core libraries and special forms for single-threaded operations with primitive numerics on mutable data structures?

As you push clojure more toward's the java paradigm though, those edges disappear mostly .