Subject: Re: [boost] [parallel_sort] Proposal
From: Christopher Jefferson (chris_at_[hidden])
Date: 2009-02-03 12:52:02


On 3 Feb 2009, at 17:34, Edouard A. wrote:

>
> On Tue, 03 Feb 2009 20:21:47 +0300, Andrey Semashev
> <andrey.semashev_at_[hidden]> wrote:
>
>> May I suggest to store iterators in the allocated storage? After
>> sorting
>> the iterators you could merge them and then apply sorting by simply
>> swapping the elements of the original sequence. If the elements are
>> fat
>> and support fast swapping, this might give some speed.
>
> Thanks for the idea, I already got a lot of feedback and I have a
> lot of
> work ahead of me. :)

Do go look at some of the pre-existing sorts, most STLs now implement
things similarly.

You should be doing most of the moving of elements during a sort using
swap (you can do all of them, but that gets a little expensive). Also,
you probably want to think about making your sort suitable for move-
only types, both for efficency (never copy anything if you don't have
to) and in preparation for such types.

Chris