[Haskell-cafe] why is rpar/rpar always faster (book Simon Marlow)?
Kees Bleijenberg
K.Bleijenberg at lijbrandt.nl
Mon Feb 1 20:31:59 UTC 2016
I'am reading the book Parallel and Concurrent Programming in Haskell. The
book has an explanation of the Eval monad. It compares rpar/rpar (example
2-1), rpar/rseq (example 2-2), rpar/rseq/rpar (example 2-3) and
rpar/rpar/rseq/rseq in rpar.hs The examples run all in the total time 0.82
s.
When I run rpar/rpar (example2-1) on my computer total time is 1.34 s. All
other examples have total time 2.22 s. I'am running the examples exactly as
written in the book. I tried the examples in opposite order, but the
rpar/rpar example remains a lot faster.
I wonder why the other examples are so much slower and why is it so
different from the book?
I run the examples on a computer with 4 cores. I'am using ghc version 7.10.1
on Win64. The Haskell version is 32 bits. If I run the examples with +RTS
-N1 all examples use the same time (2.20 sec).
Kees
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20160201/cfa5c420/attachment.html>
More information about the Haskell-Cafe
mailing list