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

Manlio Perillo manlio_perillo at libero.it
Fri Feb 20 16:54:00 EST 2009

Don Stewart ha scritto:
> dons:
>> bulat.ziganshin:
>>> Hello Achim,
>>> Friday, February 20, 2009, 11:44:49 PM, you wrote:
>>>>>> Turning this into a ticket with associated test will:
>>>>> but why you think that this is untypical and needs a ticket? ;)
>>>> Bulat, you are right in every aspect. You never did anything wrong.
>>> Achim, this is simplest code one can imagine. so when Simon will go to
>>> check ghc optimizations, he will try it without any reports. but
>>> Simon, unlike Don, never said that ghc may be compared to gcc. Don, on
>>> the other hand, say this everyday. when he is asked for code that
>>> shows this, he declined to answer. so - why YOU think that ghc
>>> generates fast code and this example is something unusual? can you
>>> provide any *technical* arguments or will continue to make personal
>>> attacks together with Don?
>> Bulat, you misunderstand, it is not personal! We just want something to
>> work on. Something specific.
>> For example, you've identified loop unrolling as something that could
>> very profitably be improved in GHC, and Claus even wrote a prototype to
>> see what kind of speedups to guess. 
>> This is a great contribution!  Now we know where to hunt.
> And just to summarise what we have seen:
>     ghc -O2 naive left fold                    15.680
>     gcc -O0                                     4.500
>     ghc manual recursion -fasm                  1.328
>     ghc manual recursion                        1.035
>     ghc naive left fold "stream fusion"         0.967
>     gcc -O1                                     0.892
>     ghc "-funroll-loops" -D8                    0.623
>     gcc -O3 -funroll-loops                      0.318
>     ghc "-funroll-loops" -D64                   0.088

As a full comparison I would like to see time for
ghc -O0 naive left fold

Manlio Perillo

More information about the Haskell-Cafe mailing list