Summary

Now we have crammed in how parallelism is done in Haskell and an overview of the threaded runtime. We parallelized pure and lazy data structures with strategies and Eval (the parallel package). For more control and parallelism in IO, we had to resort to schedules and Par (the monad-par package). We dived into data-parallel programming with Repa and even wrote a string recognition program with it.

We learned to use the event log and ThreadScope to diagnose the parallel performance of Haskell programs. Things to keep in mind when parallelizing programs are: use good granularity, not too much overhead but not too much sequential processing either; compile with flags optimized for parallelism, especially with Repa; and profile and diagnose ...

Get Haskell High Performance Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.