|
|
Warp wrote:
> I find it ironic that you constantly comment on the "unfounded" prejudices
> relating to the speed of Haskell in the other group, yet time after time you
> demonstrate in practice how Haskell is orders of magnitude slower than a
> simple C++ program. This isn't the first time that I remember.
Well, you look at Haskell and how it's used, and it "looks" like it
should be insanely slow. (E.g., recursion is used everywhere.) It's easy
to think it has no performance at all.
And yet, when you look at things like the Great Language Shootout,
Haskell beats several supposedly "superior" languages. Last time I
checked, it's near the very top of the main scoreboard.
> I have hard time believing my computer is 30 times faster than that.
> Twice or three times as fast I could still maybe swallow, but not 30 times.
> (Athlons are rather notorious for being much faster than the Pentium4 line
> with the same clockrates.)
OK, well I just wrote a small C program to do the same thing... and it
segfaulted at me.
So then I looked up the printf() manpage to find out what the correct
magic code is, and tried again... 0.8 seconds to do the integer sum.
Based in this information, I conceed defeat. I have no idea what's gone
wrong here.
PS. I just changed the Haskell program. It now takes 0.5 seconds - which
is even faster than C. But I still have no idea why the first version
wasn't this fast, so that's not much comfort.
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
|