[Haskell-cafe] Re: Haskell Speed
Peter Simons
simons at cryp.to
Sun Dec 25 07:59:49 EST 2005
Tomasz Zielonka writes:
>> wc :: String -> (Int, Int, Int)
>> wc file = ( length (lines file)
>> , length (words file)
>> , length file
>> )
>
> I have a crazy idea: what if we computed all three length
> applications concurrently, with the RTS preempting the
> thread when it generates too much unreclaimable nodes?
That's a pretty good idea, actually. What is the state of
the 'par' primitive in GHC 6.x? Now that I think of it, it
seems that adding a proper "compute in parallel" annotation
could make a big difference in this case.
Peter
More information about the Haskell-Cafe
mailing list