mergesort

Koen Claessen koen@cs.chalmers.se
Wed, 26 Jun 2002 16:06:50 +0200 (MET DST)


Simon,

 | 5.02 uses quicksort, but 5.04 will use mergesort
 | instead which has much more predictable performance
 | behaviour.

What implementation of mergesort are you using? (Could you
send me code?)

I found that all implementations of mergesort I tried
perform badly on large list (like 10000 elements). GHC blows
out of stack in that case, but not GHC's current built-in
sort function.

I assume you also realize that quicksort behaves more lazy
than mergesort, which might be the reason for the above.

I guess there should be a module from which one can pick the
best known implementation of a particular sorting algorithm.

Regards,
/Koen.