[Haskell-beginners] I get no speedup with RWH examples of parallel sorting

Kees Bleijenberg k.bleijenberg at inter.nl.net
Wed Jul 6 17:08:41 CEST 2011


I've carefully followed the instructions in Real World Haskell for parallel
sorting:
In SortMain.hs
1. Set testfunction=sort
Then del *.o  (force recompilation)
ghc --make -O2 sortMain.hs
run SortMain and I get 500000 numbers  => 3.9735 sec.
 
2. Set testFunction = parSort2 2
del *.o 
ghc -threaded --make -O2 sortMain.hs
run SortMain +RTS -N2 -RTS,  I get =>  5.3 sec
run SortMain +RTS -N1 -RTS,  I get =>  4.3 sec
With the +RTS -s option I get 3 SPARK3 (3 converted, 0 pruned)
All other testFunctions are worse.
 
I have a dual core computer that runs Windows XP. 
I've experimented a lot with par, pseq ... in other programs. I almost
always get a few hundred sparks. Half of them are converted and the other
half gets pruned. But I never got a faster program (then sequential).
 
What am I doing wrong, any ideas?
 
Kees
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20110706/145b2d3f/attachment.htm>


More information about the Beginners mailing list