|
|
|
|
|
by sreque
6058 days ago
|
|
This link is fairly illuminating of clojure's performance: http://gnuvince.wordpress.com/2009/05/11/clojure-performance.... A guy writes some Java code, writes some clojure code, and notices that the clojure code is ridiculously slower, about 100 times or more, even slower than his Python implementation! After some serious profiling and help from the clojure mailing list he gets it down to 6 times as slow. What if he decided to try to optimize the Java code even further? He might be even be able to push the gap to 10x. As far as all computers having 60 cores some day, if your clojure code is 10 times slower than my Java code, I only have to use 6 of my 60 cores to be as fast as your clojure program, which would be bringing my 60 core system to it's knees. It's not like you can't parallelize in Java! It's going to be decades indeed before a 5-10x reduction in performance doesn't matter because of ubiquitous core availability. |
|
If you take seriously the rule that most programs spend 90% of their cycles in a limited number of subroutines (and you rewrite those few locations in Java), you should get speed pretty much equivalent to the Java code.
(Of course, in benchmarks this fails, because benchmarks generally measure the places that i might rewrite).
And then you use Clojure for the tricky and error-prone flow control types of jobs. I hate it when people turn this into a 'Clojure vs. Java' debate. It isn't like that.
It is about Clojure and Java. And I think Clojure and Java wins hands down over the Java only approach (at least for a lot of applications).