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

Vo Minh Thu noteed at gmail.com
Mon Sep 13 06:41:36 EDT 2010

2010/9/13 Daniel Fischer <daniel.is.fischer at web.de>:
> On Monday 13 September 2010 11:50:14, Vo Minh Thu wrote:
>> 2010/9/13 David Virebayre <dav.vire+haskell at gmail.com>:
>> > Does it help to compile with ghc --make -O2 -funbox-strict-fields  ??
>> No, it doesn't. Can I assume you don't have the problem I described?
> Currently, GHC's native code generator is not too good at optimising loops.
> It might help if you compile via C,
> ghc -O2 -fexcess-precision -fvia-C -optc-O3
> On my box, that gives a > 2× speedup (unfortunately, that means it takes
> almost three times as long as the C version instead of > 6×).

With your options, the Haskell code is only 1.5x slower. But still...

> If you have the llvm backend for GHC, that is supposedly better for such
> code.

... the post is from 2008. No LLVM goodness. So I thought GHC 6.12.1
(not the latest and greatest HEAD) would be enough.


More information about the Haskell-Cafe mailing list