[Haskell-beginners] Performance of parallel mergesort

Tommy M. McGuire mcguire at crsr.net
Sat Dec 26 13:00:49 EST 2009


Antoine Latter wrote:
>> Here's a paste-bin link for the code in question:
> http://hpaste.org/fastcgi/hpaste.fcgi/view?id=14871#a14871


I am not familiar with Control.Parallel at all, so someone please correct me
if I'm wrong....

...but that parallel mergesort looks very wrong to me.

In the first place, the split is using the length of the list, which is going
to force the spine of the list, leaving a bazillion thunks unless the runtime
will evaluate the numerical value at each element.

More importantly, it seems to be running the forcelist in parallel with the
merge; forcelist is not going to do anything useful after the first pass over
each element, and the merge has a data dependency on the split sub-lists,
which is going to limit parallelism quite a bit.

Am I wrong here?


(Yep, Jedaï, I'm familiar with Jon and the reason he posted this here rather
than the cafe.)

-- 
Tommy M. McGuire
mcguire at crsr.net


More information about the Beginners mailing list