On Tue, Jun 30, 2009 at 12:29 AM, Konrad Hinsen<konrad.hin...@laposte.net> wrote: > What is particularly nice about Clojure is that in most situations > you don't need to switch to Java for speed. You can optimize your > code by adding type hints and switching to low-level data structures > (unboxed ints and floats, arrays, ...) and get performance equal to > Java.
I have heard this claim about Clojure's speed a number of times, and I am curious what the evidence for this claim is. As far as I know, no one has written a suite of meaningful benchmarks to compare the performance of Clojure versus Java. On the other hand, every month or so, someone posts here saying they tried to do a single benchmark, and it runs quite a bit slower than Java. People help out, and usually some ways to improve the code are found, but I don't think I've ever seen the code actually get to the point where it has "performance equal to Java". > The main limitation is that unboxed numbers can't be used at > the interface between two functions. Right, and I think without a large body of code, it remains an open question the degree to which this impacts performance in typical code. I have been satisfied with Clojure's performance so far, but if I ever do hit a performance bottleneck, I am not convinced that I will be able to annotate my way out of the problem. I have often found myself wondering whether my code would run faster if I switched to something like Scala (switching to Java would be too painful for what I'm doing, so that's off the table). Maybe not, but it bothers me that I don't know whether it would make a difference. I would love to see more benchmarking of Clojure performance versus Java and other Java languages. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---