From: Kristof Bastiaensen Date: 2006-07-27T01:20:05+09:00 Subject: Re: For performance, write it in C On Thu, 27 Jul 2006 00:55:05 +0900, harrisj wrote: >> >> Kristof Bastiaensen wrote: >>> >>> >> Interesting ... I read somewhere that the OCaml language, while >> higher-level than C (and a functional one too), runs some programs at >> least, as fast or faster than C ... >> Not sure how true that is ... >> >> Vasudev >> http://www.dancingbison.com > > You read that correctly. The problem is that nearly every benchmark I've > seen for comparing the performance of various languages has been a > repeated mathematical operation like computing a Mandelbrot Set or running > Fibonacci Sequences that all but guarantees the edge will belong to > functional languages like Haskell and OCAML or stripped-down assembly-like > languages like C (http://shootout.alioth.debian.org/debian/ for samples), > because they are best suited for straight-up number crunching. In some cases the functional version is faster because the problem can be more easily described in a functional way. But in general code produced by ocaml is about twice as slow as C, because the compiler doesn't do the same extensive optimizations as for example gcc does. But that's still pretty good. > Are there > good benchmarks for OO languages? Or dynamic languages? Are there good > benchmarks that could actually measure the types of uses I need, where I'm > building a web front end to a DB store? I don't know about you, but my job > has never involved fractals. > > True, benchmarks only measure execution speed, but they don't show if a given programmer will be productive in them. I think that's also largely a personal choice. Some people may be more productive in a functional language, some people more in Ruby. And others even in perl... :) Kristof