[Haskell-cafe] Meaning of fizzled sparks?

Ben Lippmeier benl at ouroborus.net
Wed Oct 4 11:50:35 UTC 2023



> On 3 Oct 2023, at 10:02 pm, David Banas <capn.freako at gmail.com> wrote:
> 
> Hi all,
> 
> If this code:
> 
>   f5Rslts      = map (f5 (n-1) startingMinScore startingMaxScore (otherColor clr) 0) newBoards `using` parList rdeepseq
>   totalMoves   = sum $ map snd f5Rslts  -- Attempt at parallelization yielded no perf. improvement.
> 
> is yielding a fizzled spark ratio of about 0.3,
> does it imply that the sum begins pulling from the list, before the sparks have had a chance to compute the first third of the list elements?

A fizzed spark is when the user code indicated that some thunk could be run in parallel, but it didn’t end up being run in parallel because by the time it was inspected it was already evaluated. Fizzed sparks are described in “Runtime Support for Multicore Haskell”, Marlow, Peyton Jones, Singh, ICFP 2009.

It’s hard to tell what is happening without the code for ‘f5’, though probably 30% of results produced by ‘f5’ are already values (not thunks) so they cannot be evaluated in parallel by the ‘parList’ strategy.

Ben.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20231004/50f50810/attachment.html>


More information about the Haskell-Cafe mailing list