On Friday, September 7, 2012 1:12:44 AM UTC-7, Andy Fingerhut wrote: > > Since my last message, I personally have only submitted a new faster > Clojure program for the knucleotide problem on the Benchmarks Game site. I > haven't checked whether other Clojure programs have been submitted in that > time. >
Thanks Andy (and yes, yours was the only Clojure program contributed during that time). For all of the benchmark machines below, I'd say don't worry about the > pidigits problem. It is kind of an odd case. The Clojure program does not > use the GNU gmp library for arbitrary precision integer arithmetic, but the > Java program and several other languages do. You can stress out about that > fact if you want. I don't. Life is too short. That problem simply shows > the difference between Java BigInteger performance versus the GNU gmp > library performance, not Clojure vs. Java. > Until someone contributes a Clojure program that makes use of that Java interface to GMP ;-) The rest of the problems I consider reasonably fair comparisons, although > I'd bet money the Clojure run time of several can still be reduced with > enough skill and persistence. Some day I'd like to have side by side > performance comparisons of these programs versus the easier-to-write kind > that someone is more likely to come up with on a first or second try, > rather than the tweaked-out oddities of programs on the site. > I do understand the appeal of a comparison between easier-to-write first-or-second-try kind of programs -- those programs should be easier to read and easier to understand. Then again, I think it strange to compare the performance of programs written as though performance didn't matter. When performance matters we re-write programs. pi-digits already provides an example -- the utterly naive Java example program (not so much idiomatic as idiotic) I contributed, and the Clojure pidigits programs. http://shootout.alioth.debian.org/u64q/program.php?test=pidigits&lang=java&id=1 http://shootout.alioth.debian.org/u64q/program.php?test=pidigits&lang=clojure&id=2 Lesson I've learned: If you've got an inner loop of your program that you > really really need to run faster, code it in Java, C, or even assembler. > Use profiling tools to find those spots, rather than guessing where you > think they might be. Hand-coded assembler can beat optimized C by a factor > of 2 or more in many cases, but who wants to program in assembler? For > that matter, who wants to write large programs in C? > My guess is that there are plenty of programmers who are happy to write large programs in C ;-) best wishes, Isaac -- 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