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

Bulat Ziganshin bulat.ziganshin at gmail.com
Fri Feb 20 17:26:43 EST 2009

Hello Achim,

Saturday, February 21, 2009, 12:54:33 AM, you wrote:

>> so - why YOU think that ghc
>> generates fast code and this example is something unusual?
> I think ghc has decent performance, and that there's room for
> improvement. I don't care whether you compare it to gcc,

i'm asking specifically about ghc vs gcc performance. what i'm said
is that ghc generates slow code compared to gcc, if you don't agree
with me - why you think opposite? are these reasons technical, i.e.
some numbers or not?

> if there's any way to have faster code than you get with ghc, right
> now, it's worth a bug report, even if it's going to be tagged as
> Milestone: ghc 120.10. Non-tracked issues are non-issues.

again, this looks strange. does you mean that every program you
analyzed on assembler level has perfect code? or that you just don't
need any more speed?

i personally checked ghc performance 3 years ago and wrote decent s/w
those days. i think that library i wrote was the first with hard
low-level optimization and may be becomes an inspiration for
ByteString optimizations

nevertheless, ghc cannot generate really fast code and when i need
speed, i use C++. my archiver is known as world fastest one and it's
written in C++ and Haskell combination - C++ where we need speed,
Haskell for the rest: i'm sure that it's the best combination until
ghc 120.1

next, imagine that you live 20 years ago. you wrote in C and finds that
gcc generates slower code than hand-written assembler. you report it -
are you think that next day gcc will become as fast as assembler? gcc,
like other best C++ compilers, spend many man-years before it got the
current speed. ghc back-end developed by just Simon Marlow, and he
cannot write gcc-like backend in less than 120 years, with reports or

next, the program i wrote is very primitive. are you really think that
Simon can't build a lot of such examples without my help? it's why i
consider your idea meaningless and more like an personal attack than
real concern about ghc

actually, me, like probably you, are not interested so much in better
ghc optimizing backend. it's enough fast for my tasks, i use C++ for
speed-critical code. i prefer that Simon will improve other sides of

but problem - not mine, but for haskellers, is that some people said
that ghc can generate code that is as fast as gcc one. it will be
stupid if someone will start to write say mpeg4 codec and after year
of work will find that it need 100 Ghz cpu to work. it's why i made
this test, which you are trying to fool now. people that will believe
your "arguments" instead of checking numbers may spend a lot of time
meaningless. but it's doesn't matter for you, fanatics

Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com

More information about the Haskell-Cafe mailing list