[Haskell] [Fwd: Re: Computer Language Shootout]

Donald Bruce Stewart dons at cse.unsw.edu.au
Tue Feb 27 07:11:46 EST 2007

> On Sun, 2007-02-25 at 18:57 -0800, Stefan O'Rear wrote:
> > Haskell, now:
> >  * Very much slower than C
> >  * Very much easier to use than C
> >  * Very easy to interface with C
> > 
> > So I think we should do the same.  It even shows in the Shootout - the
> > programs that are simultaneously fastest and clearest are not pure
> > Haskell, but delegate their innermost loops to tuned C libraries (FPS
> > and GMP). 
> I should note that FPS is almost completely Haskell code, not C. We use
> C for things like memcmp, memcpy, memset, reverse_copy, intersperse,
> maximum, minimum and count.
> Certainly some of the innards are low level style Haskell, though not
> the kind that could be replicated in C because we use high level
> transformations to fuse loop bodies together and wrap them in high
> performance, low level loop code.
> This is not the style where we just wrap well tuned C code, this is a
> style where we generate high performance low level code from a high
> level spec. This relies on GHC's excellent and programmable optimiser.
> It's wrong to say that the shootout improvements were only down to
> improved libraries. The performance of ByteString code improved very
> significantly between GHC 6.4 and 6.6 and a large part of that was down
> to optimiser improvements (not just the ForeignPtr rep change).

And just to point out that the optimiser is even better in GHC Head.
Thanks Simon!

Here's today's run on an amd64, with GHC 6.6 versus GHC head,


For microbenchmarks, the head is 24% faster, across the whole suite 8%.

Note the bytestring-based program, sum-col, got 40% faster purely due to
improvements in the optimiser!

-- Don

More information about the Haskell mailing list