Changes between Version 7 and Version 8 of Status/Nov07

Dec 4, 2007 2:13:55 PM (10 years ago)

add parallel gc


  • Status/Nov07

    v7 v8  
     116== Parallel GC ==
     118Since 6.6 GHC has had support for running parallel Haskell on a multi-processor out of the box.  However, the main drawback has been that the garbage collector is still single-threaded and stop-the-world.  Since GC can commonly account for 30% of runtime (depending on the GC settings), this can seriously put a crimp in your parallel speedup.
     120Roshan James did an internship at MSR in 2006 during which he and I (Simon M) worked on parallelising the major collections in GHC's generational garbage collector.  We had a working algorithm, but didn't observe much speedup on a multi-processor.  Since then, I rewrote the implementation and spent a large amount of time with various profiling tools, which uncovered some cache-unfriendly behaviour.  We are now seeing some speedup, but there is more tweaking and measuring still to be done.
     122This parallel GC is likely to be in GHC 6.10.  If you have enough cores and your program does enough GC, you might even see a speedup for purely single-threaded Haskell programs.
     124The other side of the coin is to parallelise the ''minor'' collections.  These are normally too small and quick to apply the full-scale parallel GC to, and yet the whole system still has to stop to perform a minor GC.  The solution is almost certainly to allow each CPU to GC its own nursery independently.  There is existing research describing how to do this, and we plan to try applying it in context of GHC.
    116126== Data parallel Haskell ==