-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
parTraversable not creating any sparks #17
Comments
It looks like GHC's
where |
It looks like |
Something must have gone wrong in order to get to the point where
So for |
Seems like I faced same issue trying examples from "Parallel and Concurrent Programming in Haskell" by Simon Marlow: While with Same with fib taken from book: |
* `Eval` has always been a hand-written copy of `IO`. Use a newtype wrapper around `IO` instead. This gives us the necessary instances for free and shifts the proof obligations into `base`. * Use `unsafeDupablePerformIO` instead of applying `realWorld#` directly. This should make the optimizer much less likely to eat our shorts. * Redefine `rparWith` to do the simplest thing that could possibly work. It seems to do so. * Remove the rewrite rule for `parList`; as far as I can tell, it slows things down. Fixes haskell#17
* `Eval` has always been a hand-written copy of `IO`. Use a newtype wrapper around `IO` instead. This gives us the necessary instances for free and shifts the proof obligations into `base`. * Use `unsafeDupablePerformIO` instead of applying `realWorld#` directly. This should make the optimizer much less likely to eat our shorts. * Redefine `rparWith` to do the simplest thing that could possibly work. It seems to do so. * Remove the rewrite rule for `parList`; as far as I can tell, it slows things down. Fixes haskell#17
* `Eval` has always been a hand-written copy of `IO`. Use a newtype wrapper around `IO` instead. This gives us the necessary instances for free and shifts the proof obligations into `base`. * Use `unsafeDupablePerformIO` instead of applying `realWorld#` directly. This should make the optimizer much less likely to eat our shorts. * Redefine `rparWith` to do the simplest thing that could possibly work. It seems to do so. * Remove the rewrite rule for `parList`; as far as I can tell, it slows things down. Fixes haskell#17
@glutamate this ticket explains what we saw in Feb/March I think. |
When I run this program with -s:
Sparks are created:
If I change parList to parTraversable
no sparks are created:
If I change rseq to rdeepseq:
No sparks are created
If I use parTraversable over a Map:
No sparks are created
using
rdeepseq
results in the same behavior.My cabal file has the following ghc options:
-O1 -threaded -rtsopts -with-rtsopts=-N4
I am using the stack resolver
nightly-2017-10-06
which hasparallel-3.2.1.1
andghc-8.2.1
I originally asked about this on stackoverflow and the behavior was confirmed by another user.
The text was updated successfully, but these errors were encountered: