Multi threaded garbage collector

Hi all, I did some experiments with concurrent Haskell, and unfortunately I couldn't get my code run faster when using more cores, actually it ran a bit slower. Now I noticed after profiling that about 70% of the time my program was performing garbage collection (I had lists of 50000 tiny objects that got recreated 100 times per second). If I understood it correctly, the current garbage collector of GHC is single threaded, which really hinders SMP Any plans on improving this or workarounds? Thanks, Peter

Hello Peter, Sunday, May 18, 2008, 4:47:22 PM, you wrote:
If I understood it correctly, the current garbage collector of GHC is single threaded, which really hinders SMP
Any plans on improving this or workarounds?
workaround - decrease GC times. read GHC manual for switches that control it. in particular, try +RTS -A10m afair, multithreaded gc was already implemented and should be shipped with ghc 6.10 -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com

Hi
Any plans on improving this or workarounds?
http://research.microsoft.com/~simonpj/papers/parallel-gc/index.htm Thanks Neil

Peter Verswyvelen wrote:
Hi all,
I did some experiments with concurrent Haskell, and unfortunately I couldn't get my code run faster when using more cores, actually it ran a bit slower.
Now I noticed after profiling that about 70% of the time my program was performing garbage collection (I had lists of 50000 tiny objects that got recreated 100 times per second).
If I understood it correctly, the current garbage collector of GHC is single threaded, which really hinders SMP
Any plans on improving this or workarounds?
Parallel or not, if you can figure out a way to make your program require less GC work, it will go faster. The current GC requires all Haskell threads to be halted while it does its work. I understand there is a new GC under development that uses multiple cores [i.e., a GC pass now takes less time]. However, it still required all Haskell threads to be halted while it runs. (It's just that it takes less time to run now.) Either way, if you can somehow figure out how to do less GC, you'll win. Notice that sometimes just doing work in a different order can significantly reduce GC load.
participants (4)
-
Andrew Coppin
-
Bulat Ziganshin
-
Neil Mitchell
-
Peter Verswyvelen