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

Sebastian Sylvan sylvan at student.chalmers.se
Fri Feb 20 18:42:33 EST 2009


On Fri, Feb 20, 2009 at 10:33 PM, Bulat Ziganshin <bulat.ziganshin at gmail.com
> 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
>


Bulat, please, you're missing the point. Nobody is saying that the
template-haskell trick was somehow a viable general strategy right now that
everyone should use by default. It was used as a proof-of-concept that a
simple technique can lead to massive performance improvements - and we get
numbers for how massive it would be (beating gcc for this benchmark).
This isn't about "faking" a benchmark, it's about investigating the reasons
for why the benchmark looks they way it does, doing testing to verify the
assumptions (in this case using TH), and making constructive suggestions
(add loop-unrolling to the compiler). This investigation tells us that in
this case a compiler could beat gcc, if only it were to do loop unrolling in
the way the TH code does. That's a result!

I would ask you to note the simple fact that every single constructive
message in this thread has come from people other than you. I hope this
leads you reconsider your tone and general approach in the future. Haskell
people in general are always pretty good at accepting criticism IME (they
tend to want to fix the problem), don't you think it's odd that it's only
*your* criticism that gets so much flak? Maybe some part of the reason
almost every discussion you're in here usually ends up hostile is *your*
approach?

Regards,
-- 
Sebastian Sylvan
+44(0)7857-300802
UIN: 44640862
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090220/260c002a/attachment.htm


More information about the Haskell-Cafe mailing list