Parallel Rogue-like benchmark

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Aug 25 20:44:07 PDT 2013


On 8/25/13 6:16 PM, Paul Jurczak wrote:
> On Sunday, 25 August 2013 at 23:16:17 UTC, Joseph Rushton Wakeling wrote:
>> On 26/08/13 01:06, Andrei Alexandrescu wrote:
>>> This is one of the worst PR functional programming has ever gotten,
>>> and one of
>>> the worst things FP has done to the larger community. Somebody should
>>> do hard
>>> time for this. And yes, for that matter it's a great example in which
>>> SLOCs are
>>> not a very good measure.
>>
>> I thought you'd like me bringing this up. ;-)
>
> You still have a chance, because I don't quite get it. With the little I
> know about Haskell, I find this code very elegant. What is wrong with
> it? Performance?

I ranted about that a couple of times (including during my DConf talk). 
In brief:

1. quicksort is based on in-place partition, so at best that example is 
a different (and less adequate) algorithm inspired from quicksort.

2. choosing the first element as pivot yields quadratic performance on 
almost sorted sequence, which is a common practical case.

That example is part of a toxic trifecta (also including the 
doubly-exponential fibonacci and the O(N) space factorial) that has done 
a lot of bad teaching.


Andrei



More information about the Digitalmars-d mailing list