[Haskell-cafe] Haskell Speed Myth

Thomas Davie tom.davie at gmail.com
Sat Aug 23 15:19:55 EDT 2008

On 23 Aug 2008, at 20:01, Luke Palmer wrote:

> 2008/8/23 Thomas Davie <tom.davie at gmail.com>:
>> Finally, that threading example... WOW! 65 times faster, and the  
>> code is
>> *really* simple.  The C on the other hand is a massive mess.
> I've been wondering about this, but I can't check because I don't have
> a multi core cpu.  I've heard GHC's single threaded runtime is very
> very good.  What are the results for the threading example when
> compiled with -threaded and run with at least +RTS -N2?

That's really interesting -- I just tried this.

Compiling not using -threaded: 1.289 seconds
Compiling using -threaded, but not running with -N2: 3.403 seconds
Compiling using -threaded, and using -N2: 55.072 seconds

Wow!  Haskell's runtime really is a *lot* better than trying to use  
operating system threads.  I wonder if there's a point at which it  
becomes better to use both CPUs, or if the overhead of using OS  
threads for that problem is just too high.


More information about the Haskell-Cafe mailing list