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

Thomas Davie tom.davie at gmail.com
Fri Feb 20 17:51:43 EST 2009

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

> Hello Thomas,
> Saturday, February 21, 2009, 1:19:47 AM, you wrote:
>> I'm not sure what you're getting at Bulat √ it's been demonstrated
>> that ghc is slower than gcc for most cases at the moment (many
>> benchmarks will back this up), *however*, it's also easily verified
>> that ghc has had significantly less effort directed at it than gcc  
>> and
>> other imperative compilers, thus, there are many places it can  
>> improve
>> greatly.
> of course. what fool will say that ghc cannot be optimized the same
> way as gcc? if we spent the same amount of time for improving ghc
> back-end as was spent for gcc (tens or hundreds man-years?), then
> *low-level* Haskell code will become as fast as C one, while remaining
> several times slower to write

Considering Haskell compilers have lots more guarenteed conditions to  
go on (like referential transparency etc), I'd imagine actually that  
given the same amount of effort, they could compile Haskell code to  
*much* faster code than C.
>> In this case, you've pointed out a really great source of heavy
>> optimisation.  Thanks a lot :)  Now perhaps it might be an idea to be
>> constructive, rather than trying to stand like nelson going "HA HA"  
>> at
>> the people with the inferior compiler.
> ghc is superior compiler and it's my main instrument. but it can't
> make coffee and doesn't contain sophisticated code generator. it's why
> i dissuade from writing video codes in haskell and i don't like
> situation when someone too lazy to test speed yourself tell us tales
> and attack me when i say about real situation

I'd hardly say that dons is too lazy – he has after all contributed  
rather large chunks of code to coming up with good examples, and  
optimising ghc.  Secondly, I don't see him telling tales either –  
he's being very honest about the performance of Haskell here, and how  
it might be improved.  Finally, I'd hardly call computing a constant  
in an arbitrarily complex way a "real situation".

I think someone needs to get off their high horse and reflect a little.


More information about the Haskell-Cafe mailing list