3 ms·
Simplistic idiomatic Clojure is much faster than JRuby, but often a bit slower than Java and Scala depending on how much you rely on reflection. However, if yo
by technomancy 16y ago
Simplistic idiomatic Clojure is much faster than JRuby, but often a bit slower than Java and Scala depending on how much you rely on reflection.
However, if you push it, Clojure can be as fast as anything else on the JVM; it's just a matter of how much time you spend profiling and optimizing. In many cases you can output the exact same bytecode in Clojure that you'd get from a several-times-more-verbose Java program.
An extreme example: http://meshy.org/2009/12/13/widefinder-2-with-clojure.html http://meshy.org/2009/12/13/widefinder-2-with-clojure.html
- tl 16y ago$ time echo '(println "Hello, world!")' | clojure Clojure 1.0.0- user=> Hello, world! nil user=> real 0m2.756s user 0m1.040s sys 0m0.140s $ time echo 'print "Hello, world!"' | python Hello, world! real 0m0.018s user 0m0.000s sys 0m0.010s Beware the horrible startup time for small programs.