[Haskell-cafe] benchmarking c/c++ and haskell

Jason Dagit dagit at codersbase.com
Tue Sep 14 21:06:21 EDT 2010

On Tue, Sep 14, 2010 at 5:50 PM, David Terei <dave.terei at gmail.com> wrote:
> On 13 September 2010 20:41, Vo Minh Thu <noteed at gmail.com> wrote:
>> ... the post is from 2008. No LLVM goodness. So I thought GHC 6.12.1
>> (not the latest and greatest HEAD) would be enough.
> I compiled the two programs myself out of curiosity and got the following times.
> Linux, 64bit, Ubuntu 10.10:
> 1e8
> clang: 0.180s
> gcc: 0.179s
> ghc 6.12.1 (viac): 0.187s
> ghc 6.12.1 (fasm): 0.218s
> ghc HEAD (viac): 0.186s
> ghc HEAD (fasm): 0.179s
> ghc HEAD (llvm): 0.174s
> 1e9
> clang: 1.657s
> gcc: 1.647s
> ghc 6.12.1 (viac): 1.653s
> ghc 6.12.1 (fasm): 1.975s
> ghc HEAD (viac): 1.648s
> ghc HEAD (fasm): 1.658s
> ghc HEAD (llvm): 1.646s
> So basically all have the same time except ghc 6.12.1 where fasm is a
> little slow.
> On windows xp 32bit I get quite different results which I trust less
> as the times are jumping around much more then they were on linux:

Thanks for your rather extensive effort to pin down the performance
numbers. I just wanted to add a suggestion: I would highly recommend
using criterion for this.  It's easy, simple, and good at giving you
statistically robust measures of the time it takes.


I resisted using it for a while, but once I took the plunge I was
quite happy with the results.  It's a library that is definitely worth
the spin up time (for me at least).


More information about the Haskell-Cafe mailing list