More detail: I'm on a MBP with 2.2Ghz Core 2 Duo. I used Apple's standard GCC 4.0.1 to compile with no settings (gcc fib.c -o fib). The same code with Apple's GCC 4.2 produced the same time, I didn't think to use an optimization flag as I haven't written C in a decade.
It looks like Michael's results with O3 and gcc 4.3 are pretty impressive. As noted in the comments for my blog post, type hints and unchecked math operations shave about 40% off the runtime. mike On Dec 14, 11:08 am, James Reeves <weavejes...@googlemail.com> wrote: > On Dec 14, 2:01 pm, Mike Perham <mper...@gmail.com> wrote: > > > Hi, I'm just learning Clojure but I thought I would do a little > > experiment to see where Clojure sits performance-wise compared to a > > number of other languages on the old Fibonacci sequence. I think it > > handles itself quite well. > > Interesting, but because your tests use a very inefficient algorithm, > this is more a test of recursion than general performance. I find it > quite intriguing that Java came out on top of GCC; I guess that must > be Hotspot performing some optimizations. > > - James --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---