[Haskell-cafe] GHC threaded runtimes and pure functions

Andrew Coppin andrewcoppin at btinternet.com
Thu Sep 17 04:14:19 EDT 2009


Bulat Ziganshin wrote:
> Hello Andrew,
>
> Wednesday, September 16, 2009, 11:31:22 PM, you wrote:
>   
>
>> If you're going to use par, it doesn't really matter how many sparks you
>> create. You just need to avoid creating millions of really tiny sparks.
>> You could create, say, eight and let GHC figure out the rest itself...
>>     
>
> since these are green threads, 1 millisecond sparks should be
> acceptable and may be even 1 microsecod too.

Of course, how many split seconds it takes depends on the speed of the 
processor running it. ;-) But you probably don't want to spark, say, one 
addition operation. (Unless perhaps you're adding *really huge* 
arbitrary-precision integers or something.) Actually, it might be 
interesting to benchmark where the balance tips; exactly how much work 
you need to do for the spark overhead to be worth it. It's likely to 
vary by GHC version though...

> afair, overhead expenses
> was significantly reduced in ghc 6.12, soon to be released
>   

I've heard similar things. I think I even read a paper about it. (Those 
GHC guys... always putting out such interesting papers! If it weren't 
for them, I might actually get some work done...) If you wanted to 
benchmark anything, it would seem prudent to wait for this. ;-)



More information about the Haskell-Cafe mailing list