[Haskell-cafe] Re: speed: ghc vs gcc

Thomas Davie tom.davie at gmail.com
Fri Feb 20 17:41:24 EST 2009

On 20 Feb 2009, at 23:33, Bulat Ziganshin wrote:

> Hello Achim,
> Saturday, February 21, 2009, 1:17:08 AM, you wrote:
>>> nothing new: what you are not interested in real compilers  
>>> comparison,
>>> preferring to demonstrate artificial results
>> ...that we have a path to get better results than gcc -O3
>> -funroll-loops, and it's within reach... we even can get there now,
>> albeit not in the most hack-free way imaginable?
> well, can this be made for C++? yes. moreover, gcc does this trick
> *automatically*, while with ghc we need to write 50-line program using
> Template Haskell and then run it through gcc - and finally get exactly
> the same optimization we got automatic for C code
> so, again: this confirms that Don is always build artificial
> comparisons, optimizing Haskell code by hand and ignoring obvious ways
> to optimize Haskell code. unfortunately, this doesn't work in real
> live. and even worse - Don reports this as fair Haskell vs C++
> comparison

You need look no further than the debian language shootout that things  
really aren't as bad as you're making out – Haskell comes in in  
general less than 3x slower than gcc compiled C.

Of note, of all the managed languages, this is about the fastest –  
none of the other languages that offer safety and garbage collection  
etc get as close as Haskell does.


More information about the Haskell-Cafe mailing list