[Haskell-cafe] Haskell not usally faster

Chris Kuklewicz chris at mightyreason.com
Fri Feb 10 08:18:14 EST 2006

Stefan Holdermans wrote:
> Don Stewart wrote:
>> P.S. I remember having a discussion on #haskell 2 weeks ago where we all
>> agreed that Haskell placing #1 was pretty much impossible. Did we have
>> an inferiority complex?
> Still---and, please, forgive me for this---I feel that us being #1 now
> tells us more about the Haskell community than it tells us about Haskell.
> Regards,
>   Stefan

Point taken.  But I think it *has* revealed a lot about Haskell:

(1) "The language of Haskell" :  It proved that Haskell's syntax allows for a
good lead in the lines of code benchmark.  If you ignore the 5 benchmarks
without a Perl entry, then Haskell still wins and Perl is second.  More concise
than Perl is something that most people would consider to be non-trivial.

(2) "The implementation of GHC 6.4.1": It proved the GHC runtime system is
incredibly efficient at concurrency.  It proved GHC can beat GCC in some cases.
 It proved that the memory consumption of lazy+strict Haskell is competitive
with explicitly managed memory in c++ (g++) and strict but garbage collected OCaml.

(3) "The libraries of GHC 6.4.1": It has emphasized which bits of GHC has to be
worked around, where the provided library is simply too inefficient.  This is
usually not new information, but it does provide an (more) objective benchmark.

And now for some perspective on speed:

Comparing Haskell to OCaml, Haskell is almost always slower.  For CPU time
Haskell wins on 5, OCaml wins on 13 benchmarks (OCaml is missing 1 program).
But for two of those 5, the thread benchmarks, Haskell is 107x and 129x faster.
This amazingly large margin skews the ranking.  Aside from threading, OCaml wins
on 13 vs 3 for Haskell.  Ignoring the these two threaded benchmarks, OCaml is
3rd behind C and D, while Haskell is 8th behind SML MLton.

So is Haskell the fastest?  No, not unless you need to do an amazing amount
threaded processing.

Actually, comparing Haskell to C shows C/gcc faster on 10 to 6 with Haskell/GHC
faster (C is missing 3 programs).


More information about the Haskell-Cafe mailing list